开发者

make an intent from an object onstead of a class

I'm trying to make an intent by sending an object instead of a class.

instead:

I开发者_开发问答ntent intent = new Intent(EXGPS.this, LocationGPS.class);

I need:

LocationGPS gps = new LocationGPS(this);
Intent intent = new Intent(EXGPS.this, gps);

I have to do it in some way cause I cant pass my LocationGPS contructor that is getting Context c.

thank you in advance :-)


Don't do it that way. Set up a Global class which has a static reference to your Application's Context. Reference that static field directly from your LocationGPS class.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜