In my app when app start for the first time and I press Home button from device. And then start it again its start from beginning. After that each time I start it and press Home key and then start it again its start from same point where I leave it. How to solve this first time run error?
Code-
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.history);
textView1 = (TextViewEx) findViewById (R.id.textView1);
textView1.setText("Text", true);
textView1.setMovementMethod(new ScrollingMovementMethod());
}
public void onBackPressed()
{
intent = new Intent(History.this, MainActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
finish();
}
@Override
protected void onPause() {
super.onPause();
objIntent = new Intent(History.this, PlayAudio.class);
stopService(objIntent);
}
@Override
public void onResume()
{
super.onResume();
objIntent = new Intent(History.this, PlayAudio.class);
startService(objIntent);
}
@Override
protected void onStop() {
super.onStop();
}
}