| Author |
How to Start New Activity
|
Muhammad Imad Qureshi
Ranch Hand
Joined: Sep 13, 2005
Posts: 238
|
|
How do I start new activity from an activity. I want to start a new activity from on click listener. Basically, I have a class that extends "Activity" and I would like to call its onClick method but I do not have a Bundle object available.
Thanks
Imad
|
 |
Pratik Goswami
Ranch Hand
Joined: Mar 02, 2009
Posts: 136
|
|
Hi Imad,
Just use,
Thanks
Pratik Goswami
|
iOS * Android Developer
|
 |
Monu Tripathi
Rancher
Joined: Oct 12, 2008
Posts: 1365
|
|
|
You should consider reading this and maybe bookmark it. You can find answer to your question under the question: Opening a new screen
|
[List of FAQs] | [Android FAQ] | [My Blog] | [Samuh Varta]
|
 |
Muhammad Imad Qureshi
Ranch Hand
Joined: Sep 13, 2005
Posts: 238
|
|
Thanks a lot for your reply. Now I am getting following error although I have added activity to my manifest file.
android.content.ActivityNotFoundException: Unable to find explicit activity class {com.android.imad.futureValue/FutureValueFunction}; have you declared this activity in your AndroidManifest.xml?
Here is my manifest file. Future Value is actually started by payment function.
Thanks
Imad
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.imad.paymentFunction"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".PaymentFunction"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.android.imad.futureValue.FutureValueFunction"
android:label="@string/fvText">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="6" />
</manifest>
|
 |
Monu Tripathi
Rancher
Joined: Oct 12, 2008
Posts: 1365
|
|
A few things :
1. Use code tags when posting code, it improves readability.(You can use the Edit Button)
2. Note that only one of the activity should be having :
in their intent filter, other wise you will see two different icons for your application in the Launcher menu.
3. Can you also post the code you used to start the new Activity?
|
 |
Muhammad Imad Qureshi
Ranch Hand
Joined: Sep 13, 2005
Posts: 238
|
|
Thank you so much Monu. I resolved this problem and this is how I am doing it now.
and in my java file I have
Would you like to add any suggestion to this?
Thanks
Imad
|
 |
Monu Tripathi
Rancher
Joined: Oct 12, 2008
Posts: 1365
|
|
|
Looks good to me.
|
 |
 |
|
|
subject: How to Start New Activity
|
|
|