How to send data from Fragment to an Activity in Android?

Android:"Thread exiting due uncaught exception"-Not showing activity?

  • When i run the app the first activity page is fine and then when i press on the button the app gets force closed, when i debug the app i get the error above in the title. Heres my code for activity 1: package android.app; import android.app.Activity; import android.app.R; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.Button; public class AndroidActivity extends Activity{ /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Button next = (Button) findViewById(R.id.Start_CoolWhapp); next.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { Intent myIntent = new Intent(view.getContext(), activity2.class); startActivityForResult(myIntent, 0); } }); } } and my manifest.xml: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.co… package="android.app" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="7" /> <application android:icon="@drawable/ic_launcher" android:label="@string/app_name" > <activity android:name=".AndroidActivity" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN… /> <category android:name="android.intent.category.LA… /> </intent-filter> </activity> <activity android:name=".Activity2"></activity> <activity android:name=".next" ></activity> </application> </manifest> Thanks any more questions on this question email me!

  • Answer:

    research this kinda thing: method(parameter param) throws Exception if its not a built in possible exception then you need to warn java the method may throw it.

Izzy at Yahoo! Answers Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.