Android Forums

Go Back   TalkAndroid Forums > Android Coders > Android Development, Answers, Tutorials, and Code Snippets
Connect with Facebook

Click Here To Register!
 
 
LinkBack Thread Tools Display Modes
Old 12-16-2009, 02:09 AM   #1
Junior Member
 
Join Date: Dec 2009
Posts: 1
Friends: 0
View ritusingh's Profile   View ritusingh's Photo Album   View ritusingh's Blog   View Social Groups
Hi Frens...

Can anyone please tell me that how to move from one activity to another using the class intent.
i have followed the code:-

Intent intent=new Intent();
in.setClass(this.MainActivity,subactivity.class);
startActivity(intent);

this code is not working .
what changes should i made so that i can able to execute my program?
pls help me out.

Thanx-
Ritu Singh
ritusingh is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in Technorati
Old 03-19-2010, 02:38 AM   #2
Junior Member
 
Join Date: Mar 2010
Posts: 11
Friends: 0
View ARMIGER1's Profile   View ARMIGER1's Photo Album   View ARMIGER1's Blog   View Social Groups
That code would be correct. Did you add the subactivity to the Android manifest? That should fix the problem.
ARMIGER1 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in Technorati
Old 09-07-2010, 06:48 AM   #3
New Member
 
Join Date: Sep 2010
Location: India
Posts: 1
Friends: 0
View Nandhinidavi's Profile   View Nandhinidavi's Photo Album   View Nandhinidavi's Blog   View Social Groups
Send a message via AIM to Nandhinidavi
Can anyone please tell me that how to move from one activity to another using the class intent.
i have followed the code:-

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

user = (EditText) findViewById(R.id.EditText01);
password = (EditText) findViewById(R.id.EditText02);

login = (Button) findViewById(R.id.logon);
close = (Button) findViewById(R.id.Button02);

close.setOnClickListener(new View.OnClickListener (){

public void onClick(View v){

finish();

}
});

login.setOnClickListener(new View.OnClickListener() {

public void onClick(View arg0) {

Intent intent = new Intent ();
intent.setClass(Login.this, UrlReader.class);
startActivityForResult(intent, 0);
finish();
}
});
}

and another activity coding is :-

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Intent intent = new Intent();
setResult(RESULT_OK,intent);
}


Then My manifest.xml coding is:-

<activity android:name=".Login" 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=".UrlReader" >
</activity>
</application>

But it displaying error...
please reply me.....
Nandhinidavi is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in Technorati
 

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to loop the activities from a tag activity malli.ch Android Games And Applications 0 10-08-2009 09:18 AM
How to invoked Service by Activity? tomatoboy Android Development, Answers, Tutorials, and Code Snippets 0 07-20-2009 07:25 PM
How can i send Activity object to another activity through intent? santosh.1243 Android Development, Answers, Tutorials, and Code Snippets 2 06-28-2009 10:08 PM
Server Move Andor Site Feedback 1 04-21-2008 06:27 AM


Unlocked G1 Phones | Buy T-Mobile G1 | Google Phone

All times are GMT -6. The time now is 02:39 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.
Copyright (c) 2012 TalkAndroid.com. All rights reserved.