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
Related Q & A:
- How to make a thread wait until another thread finishes?Best solution by Stack Overflow
- How to add fragment activity to activity?Best solution by Stack Overflow
- How to show alertdialog without showing activity?Best solution by stackoverflow.com
- How to open current activity with android notification?Best solution by Stack Overflow
- How to get the value of android activity?Best solution by Stack Overflow
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
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.