本文介绍了我如何从其他Java类中调用活动类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我刚启动android.
I have just started android.
我只想知道如何从其他Java类中调用活动类.
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.
请任何帮助.
public class GsonParser extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
MagazineThread thread=new MagazineThread();
thread.start();
}
public GsonParser(JsonMagazineParser Obj)
{
}
}
我和其他同学一样.GsonParser obj = new GsonParser(this);将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.
你能告诉我吗?
推荐答案
看看文档: http://developer.android.com/reference/android/app/Activity.html
具体是startActivity和startActivityForResult
specifically startActivity and startActivityForResult
这篇关于我如何从其他Java类中调用活动类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!