如何描述县的背景,如果发言,则活动也相应。 说明如何做到这一点。
Context mContext = getApplicationContext();
final Dialog dialog = new Dialog(mContext);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
final Button quicktab = (Button) findViewById(R.id.btnA4);
quicktab.setOnClickListener(new OnClickListener()
{
@Override
public void onClick(View v)
{
Button a4 = (Button)findViewById(R.id.btnA4);
if ( a4.getBackground() == (R.drawable.quick_btn_background)); ****ERROR****
{
if (this.setContentView() = this.setContentView(findViewById(R.layout.layout_24)); ****ERROR****
{
dialog.setContentView(R.layout.popup_24);
}
else (this.setContentView() = this.setContentView(findViewById(R.layout.layout_63)); ****ERROR****
{
dialog.setContentView(R.layout.popup_63);
}
}
else
{
finish();
}
}
});
所有编码或标识错误。 任何帮助都是空洞的。 如果说的话,似乎不能发现与这种说法有任何关系。
****Update******** Still having errors on new code. on getBackground code, I get error: Incompatible operand types Drawable and int. on getContentView code, I get error: create method getContentView.
Context mContext = getApplicationContext();
final Dialog dialog = new Dialog(mContext);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
final Button quicktab = (Button) findViewById(R.id.btnA4);
quicktab.setOnClickListener(new OnClickListener()
{
@Override
public void onClick(View v)
{
Button a4 = (Button)findViewById(R.id.btnA4);
if (a4.getBackground() == R.drawable.quick_btn_background)
{
if (this.getContentView() == R.layout.layout_24)
{
dialog.setContentView(R.layout.popup_24);
}
else if(this.getContentView() == R.layout.layout_63)
{
dialog.setContentView(R.layout.popup_63);
}
}
else finish();
}
});