使用意图,开始从ListActivity新活动 [英] Using an intent to start new activity from ListActivity

查看:85
本文介绍了使用意图,开始从ListActivity新活动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我ListActivity对,我想用使用意图启动一个新的活动底部的按钮。当我试图说<​​code>意向意图=新意图(这一点,OtherActivity.class)我收到一个错误,构造函数是不确定的。 FWIW,其他活动来延长MapActivity。不知道如果该事项...

my ListActivity has a button on the bottom that I want to use to fire up a new activity using an intent. When I tried saying Intent intent = new Intent(this, OtherActivity.class) I'm getting an error that the constructor is undefined. FWIW, the other activity extends MapActivity. Not sure if that matters...

什么我需要做的就是这个工作?

What do I need to do to get this to work?

推荐答案

我敢打赌,我的内衣这个修复它:

I bet my underwear this fixes it:

Intent intent = new Intent(NameOfYourListActivity.this, OtherActivity.class)

这篇关于使用意图,开始从ListActivity新活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆