I have a clock done by updating a TextView text using a Runnable. When I'm in the Activity the TextView is updated properly, but when I leave and come back to the activity, the code in the run() method is not executed anymore.
Do I have to call run() again in the onResume of my activity? Why?
0 down vote favorite
I have been searching a lot to find a way to do this. But nothing seems to be working for me.
@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 had make FBLogin demo using this tutotial
Code is here //MainActivity.java
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
// start Facebook Login
Session.openActiveSession(this, true, new Session.StatusCallback() {
// callback when session c
I'm trying to write a app, where it should speak what ever String i give here is my code... Is there any problem in that let me know plz....
I have a fairly simple DialogFragment.
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 have next problem:
I create a custom BroadcastReceiver and register it in main activity onCreate handler:
public class MainActivity extends ListActivity {
private static final LogReceiver logReceiver = new LogReceiver();
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
LocalBroadcastManager.getInstance(this).registerReceiver(logRece
I am not sure why my code isn't working, following the android developer guide this should work. I assume that it is because I don't have a preferences file created, I am not sure how to go about that.