Start activity with a non activity class

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Start activity with a non activity class

Postby zahidalinaqvi » Wed Sep 09, 2009 9:05 pm

hello,

i want to invoke another activity with a non activity class.

means i m creating a class which have one method only. which is returning me text view.

now i want to invoke a new class with its onClick event.

i can write onClick on its uses class coz i m calling this class in a loop.
User avatar
zahidalinaqvi
Developer
Developer
 
Posts: 35
Joined: Mon Aug 11, 2008 8:54 am
Location: Jaipur India

Top

Postby padde » Wed Sep 09, 2009 11:17 pm

Make a static function in your class that extends activity that start the new activity
or pass a static context object from your activity class to the other class. On that
context object u can start a new activity. There are a few more solutions but i would
prefer one of those two or completely avoid that issue with a better design of the
underlying architecture of the app.
padde
Master Developer
Master Developer
 
Posts: 443
Joined: Wed Apr 08, 2009 4:52 pm

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 6 guests