i used this code for find my location(latitude and longitude) but this code sometimes
response quickly (A few seconds) and sometimes it has a delay of More than 10 minutes .
where is the problem(s)?
public class MainActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_
I have two activities:
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
public void click(View view) {
Intent intent= new Intent(this, TranslucentActivity.class);
startActivity(intent);
}
}
public class TranslucentActivity extends Activity
i am having trouble with adding more then one proximity alert to my location listener. i already searched the internet but found nothing helpful. please let me know if i am doing some thing wrong .
@Override
public void onSaveInstanceState(Bundle savedInstanceState) {
// Save UI state changes to the savedInstanceState.
// This bundle will be passed to onCreate if the process is
// killed and restarted.
savedInstanceState.putLong("lastSend", lastSent);
//more variables stored
}
/** Called when the activity is first created.
I Have been working on this program as an assignment and this question I have been trying to answer and to me it should be just:
Bundle data = getIntent().getExtras();
But it is incorrect!
The code below and the question below is what leads me to this answer.
import android.app.Activity;
import android.os.Bundle;
public class HelloWorld extends Activity {
/** Called when the activity is
I have a button that links to another activity, when I click on it it goes to the layout.xml I want it to
This is the java file for the main/first screen
Button button;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
addListenerOnButton();
}
public void addListenerOnButton() {
final Context context
I need to give some alert text message while some initilizing work is going on.
I have made a program of simple alert box in android.now i have to put two buttons "OK" and "cancel" but when i run the program it only shows ,the "cancel" button...my code is as below:
Main.java
public class MainActivity extends Activity {
Button btn;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout
My application works fine on an emulator but when i run it on tablet. I get nullpointer exception.