English 中文(简体)
如果说明附有纽芬兰语的背景和活动,则说明
原标题:If Statement with button background, and activity layout

如何描述县的背景,如果发言,则活动也相应。 说明如何做到这一点。

  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();

    }
  });
问题回答

请不要在您的<条码>上附上一个半殖民地,如果是的话,并加上一些失踪的封闭式母体,并且 s子应当被罚款。 与此类似:

  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.setContentView() == this.setContentView(findViewById(R.layout.layout_24)))
              {
                  dialog.setContentView(R.layout.popup_24);
              }
              else if(this.setContentView() == this.setContentView(findViewById(R.layout.layout_63))
              {
                  dialog.setContentView(R.layout.popup_63);
              }
              else finish();
          }
    }
});

然而,我完全无法确定,你必须比较<条码>。 Don t You mean getContentView some where? 希望这一帮助,好幸运......

<代码>R.drawable.quick_btn_background is an numeric resources id (int or long - notfirm) while a4.getBackground( Return a Drawable. 因此,这两者的比较毫无意义。





相关问题
Very basic WPF layout question

How do I get this listbox to be maxiumum size, i.e. fill the group box its in. I ve tried width="auto" Height="auto", width="stretch" Height="stretch" annoyingly at the moment, it dynamicly sizes to ...

How to align the text to top of TextView?

How to align the text to top of a TextView? Equivalent Android API for Swings setInsets()? that is top of text should start be in (0,0) of TextView <?xml version="1.0" encoding="utf-8"?> <...

Centring a flow in Shoes

Can I center the contents of a flow in Shoes? I know that a paragraph can be centred like: para Centred paragrpah , :align=> center However, this does not work with flows: flow(:align=> ...

Overlaying with CSS

I want to load a website in an iframe, and overlay the website with some hints about the website that is shown. However, i got stuck at the point that the website has a variable passive white space at ...

How do you normally make a program look beautiful? [closed]

How can I make an Application look nice and not like an amateur pulled it together? I mean graphic-wise. Is there some sort of book you can read regarding beautiful program layouts, etc? I put this ...