开发者

how can i call activity class from other java class?

I have just started android.

I just want to know that how can i call activity class from other java class.

i just want to pass class object to activity class.

anyhelp please.

public class GsonParser extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanc开发者_如何学JAVAeState);
    setContentView(R.layout.main);
    MagazineThread thread=new MagazineThread();
    thread.start();
}
public GsonParser(JsonMagazineParser Obj)
{

}

}

and i am just doing like from other class. GsonParser obj=new GsonParser(this);passing obj to activity class.how can i achieve that.

can u please tell me.


import android.content.Context;
import android.content.Intent;

public class Genfunctions {
    public void menuActions(String title,Context ct){

        //this.context=context;
        switch (title){
            case "ENTRIES":

                Intent intent = new Intent(ct, RptentrylistActivity.class);
                ct.startActivity(intent);
                break;
        }
    }//end of functions
}


Have a look at the documentation: http://developer.android.com/reference/android/app/Activity.html

specifically startActivity and startActivityForResult

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜