how to get previous activity after scrolling last screen.in the following code i did as when last screen i wrote intent to call previous activity it was calling but it refresh all data in that and calling all the fields in that as null and calling i want to call as before calling how it is like that only.when i press backpress at bottom it is fine it getting the previous activity but when i call activity it gets null values.
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.learnmore);
realViewSwitcher=(com.RealViewSwitcher)findViewById(R.id.realviewswitcher);
mainlayout=(RelativeLayout)findViewById(R.id.mainlayout);
final int[] backgrounds = { R.drawable.braven_1_bankpercentage,R.drawable.braven_2_outputs,
R.drawable.braven_3_findme,R.drawable.braven_4_sos,R.drawable.braven_5_bearmode};
for (int i = 0; i < 6; i++) {
TextView textView = new TextView(getApplicationContext());
textView.setGravity(Gravity.CENTER);
try{
textView.setBackgroundResource(backgrounds[i]);
}
catch(Exception e){
e.printStackTrace();
}
realViewSwitcher.addView(textView);
}
realViewSwitcher.setOnScreenSwitchListener(onScreenSwitchListener);
}
private final RealViewSwitcher.OnScreenSwitchListener onScreenSwitchListener = new RealViewSwitcher.OnScreenSwitchListener() {
@Override
public void onScreenSwitched(int screen) {
if(screen==5)
{
Intent intent=new Intent(LearnMore.this,DeviceControlActivity.class);
startActivityForResult(intent, 0);
}
Log.d("RealViewSwitcher", "switched to screen: " + screen);
}
};