Hi Rui Wu,
Happy New Year!!!!!
Thanks for reply me with the code. I tried for the current activity
which holds the data while the second activity is started and get back
to the current activity by pressing the previous button with using of
your code. But every time i got the NullPointerException error. I can
go on next activity but when i trying to back on the previous
activity, i got an exception.
Here, i have placed my code without added your code and i want that
you just modified this code and reply me. So, can you help me to out
from this problem?
The "first.xml" file consist two edittext and one button & the
"second.xml" file consist one button.
FirstActivity.java
------------------
// Organised imports...
public class FirstActivity extends Activity{
private EditText edFirstName, edLastName;
private Button btnNext;
@Override
public void onCreate(Bundle b){
super.onCreate(b);
setContentView(R.layout.first);
edFirstName = (EditText)findViewById(R.id.editFirst);
edLastName = (EditText)findViewById(R.id.editLast);
btnNext = (Button)findViewById(R.id.btnNext);
btnNext.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v){
Intent intent = new Intent(FirstActivity.this,
SecondActivity.class);
startActivity(intent);
}
});
}
}
SecondActivity.java
-------------------
// Organised imports...
public class SecondActivity extends Activity{
private Button btnPrev;
@Override
public void onCreate(Bundle b){
super.onCreate(b);
setContentView(R.layout.second);
btnPrev = (Button)findViewById(R.id.btnPrevious);
btnPrev.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v){
Intent intent = new Intent(SecondActivity.this,
FirstActivity.class);
startActivity(intent);
}
});
}
}
Thanks,
Regards,
-------------
Pranav
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en