Current behaviour:
I am calling an intent on button click from activity1 as shown below:
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button button = (Button)findViewById(R.id.button);
button.setOnClickListener(mCorkyListener);
}
// Create an anonymous implementation of OnClickListener
private OnClickListener mCorkyListener = new OnClickListener() {
public void onClick(View v) {
Intent myIntent = new
Intent(v.getContext(),testLinearLayout.class);
startActivityForResult(myIntent, 0);
}
};
Here is my activity2 defined in class testLinearLayout:
public class testLinearLayout extends Activity
{
public void oncreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main2);
Button next = (Button) findViewById(R.id.Button02);
next.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
Intent intent = new Intent();
setResult(RESULT_OK, intent);
finish();
}
});
}
manifest.xml
<activity android:name=".testLinearLayout">
</activity>
I want to call my testLinearLayout activity on button click(button) but not able to.
I am not getting any error mesage, but Still I am unable to get the contents shown in main2.xml...
Please provide me a solution to it..