关于eclipse的问题,我是想让3个button分别实现不同功能
eclipse吧
全部回复
仅看楼主
level 1
现在是实现了,但现在如果我改变这三个button的顺序
,例如把拨号与百度调换位置,变成
,则拨号实现的是原来百度的功能,即相同的位置相同的功能。
下面是button功能的实现;
Button button1=(Button) findViewById(R.id.button_1);
button1.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO 自动生成的方法
//Toast.makeText(FirstActivity.this, "点我干嘛", Toast.LENGTH_SHORT).show();
Intent intent=new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("http://www.baidu.com"));
startActivity(intent);
}
});
Button button2=(Button) findViewById(R.id.button_2);
button2.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO 自动生成的方法
//Toast.makeText(FirstActivity.this, "点我干嘛", Toast.LENGTH_SHORT).show();
Intent intent=new Intent(Intent.ACTION_DIAL);
intent.setData(Uri.parse("tel:10086"));
startActivity(intent);
}
});
Button button3=(Button) findViewById(R.id.button_3);
button3.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO 自动生成的方法
Toast.makeText(FirstActivity.this, "点我干嘛", Toast.LENGTH_SHORT).show();
/*Intent intent=new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("http://www.baidu.com"));
startActivity(intent);*/
}
});
2015年07月27日 05点07分 1
level 1
button的定义
<Button
android:id="@+id/button_1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="百度" />
<Button
android:id="@+id/button_2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="拨号" />
<Button
android:id="@+id/button_3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="别动我" />
2015年07月27日 05点07分 2
level 1
纯新人啊,有人来帮帮我吗[乖]
2015年07月27日 05点07分 3
level 4
[温暖]
2015年07月27日 10点07分 4
level 8
lz
还在吗?
你用的VE插件吗?
能把你的Eclipse给我发一份儿吗。。
我的VE1.5.0版本死活装不上去了。。而且VE最高支持到3.6.1
2015年07月29日 11点07分 6
Ve插件什么鬼,是ADT吗
2015年07月29日 11点07分
插件visual edit?
2015年07月29日 14点07分
level 3
推荐一个论坛(landingbj技术论坛),里面有很多专业人士。
2015年07月30日 06点07分 7
1