0
我试图在新布局加载时使按钮可点击... 因为发生了什么......我在布局1上,并且我有几个显示的按钮... 当我按下一个按钮时,它会立即显示一个新的布局,其中包含另一个.xml的按钮。 但它不会让我点击布局2上的任何东西。 我如何使它发生? 我的代码如下,从布局1到布局R.layout.fail。Android - 当新布局加载时,如何使按钮可点击
Button SectiontwoButton = (Button) findViewById(R.id.Sectiontwo);
SectiontwoButton.setOnClickListener(new OnClickListener() {
private Uri Uri;
@Override
public void onClick(View v) {
setContentView(R.layout.fail);
Uri uri=Uri;
Intent i=new Intent(Intent.ACTION_VIEW, uri);
mSoundManager.playSound(1);
}
});
感谢
瓦希德
是否有工作示例代码?谢谢 – Wahid
http://www.androidpeople.com/android-viewflipper-example。这是一个简单的教程 – blessenm
是否有另一个示例。因为我已经尝试过这个示例,所以仅仅因为我处理的图片不是TextView而有点令人困惑。 – Wahid