Using java Syntax Highlighting
- public class friendfind extends Activity {
- public String Location = new String("ena");
- @Override
- protected void onCreate(Bundle icicle) {
- super.onCreate(icicle);
- setContentView(R.layout.search);
- final Intent i1 = new Intent(this, friend.class);
- Button addbutton = (Button) findViewById(R.id.button);
- addbutton.setOnClickListener(new View.OnClickListener() {
- public void onClick(View v) {
- // Perform action on click
- Location =((EditText)findViewById(R.id.location)).getText().toString();
- startSubActivity(i1,0);
- }
- });
- }
- }
Parsed in 0.059 seconds, using GeSHi 1.0.8.4
and In second class we access Location variable value
Using java Syntax Highlighting
- public class friend extends ListActivity {
- friendfind f=new friendfind();
- protected void onCreate(Bundle icicle) {
- super.onCreate(icicle);
- Log.i(TAG,"Location ="+f.Location);
- }
- }
Parsed in 0.030 seconds, using GeSHi 1.0.8.4
but it's show NULLPOINTER error in second class
How to access value in second class????




