title: startActivity from BroadcastReceiver Button Views on Activity don't show up
body: <p>I start my activity alarmAlert.class from onReceive().
  The activity was started .
  There three buttons and two TextViews on my activity.
  when the activity started ,Textviews always show up,
  but the buttons not always show up.</p>
  
  <p>I start the activity from my MainActivity ,all the views work
  perfect </p>
  
  <p>Anything I can do .
  thanks </p>
  
  <p>I got something.
  If my App is not running in background (click menu button,remove the app from list)
  the activity started from onReceive() , buttons will not show up.
  if the App still run in background ,everything is perfect .  </p>
  
  <p>my onReceive code:</p>
  
  <pre><code>    @Override
  public void onReceive(Context context, Intent intent) {
      // TODO Auto-generated method stub
      int id = intent.getIntExtra("id", -1);
  
      try{
      Intent alertIntent=new Intent();
      alertIntent.setClass(context, AlarmAlert.class);
      Bundle bundle=new Bundle();
      bundle.putInt("id", id);
      alertIntent.putExtras(bundle);
      alertIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_NO_USER_ACTION);
      context.startActivity(alertIntent);
      }
      catch (Exception e){
          AlarmGloble.writeLog(context,"AlarmReceiver:"+e.toString());
      }
  </code></pre>
  
  <p>part of my AlarmAlert code </p>
  
  <pre><code>        @Override
  protected void onCreate(Bundle savedInstanceState) {
      // TODO Auto-generated method stub
      Log.d("AA","onCreate");
  
      super.onCreate(savedInstanceState);
      setContentView(R.layout.alarm_alert);
  
      AlarmGloble.dbHelper=new DBHelper(this,AlarmGloble.DB_NAME,AlarmGloble.DB_VERSION);
      AlarmGloble.dbLib=new DataBaseLib(AlarmGloble.dbHelper);
  
      settingFromId();
  
      findViews();
      setListener();
      updateView();
      mVibrator=(Vibrator)getSystemService(Context.VIBRATOR_SERVICE); 
  
      setSystemVolume(0);
  
      //play mp3 by Handler
      mHandler.sendMessage(mHandler.obtainMessage(PLAY));
  
  
  }
  
      private void updateView(){
      TextView textViewSnooze=(TextView)findViewById(R.id.alarm_alertTextViewSnooze);
      if (mp3Test){
          textViewSnooze.setVisibility(View.INVISIBLE);
          spinnerSnooze.setVisibility(View.INVISIBLE);
          buttonClose.setVisibility(View.INVISIBLE);
          buttonEdit.setVisibility(View.INVISIBLE);
      }
      else {
          textViewSnooze.setVisibility(View.VISIBLE);
          spinnerSnooze.setVisibility(View.VISIBLE);
          buttonClose.setVisibility(View.VISIBLE);
          buttonEdit.setVisibility(View.VISIBLE);
  
          if(alarmRept&lt;=0){           
              textViewSnooze.setVisibility(View.VISIBLE);
              spinnerSnooze.setVisibility(View.VISIBLE);
          }
          else{
              textViewSnooze.setVisibility(View.INVISIBLE);
              spinnerSnooze.setVisibility(View.INVISIBLE);
              if (alarmReptCount&lt;alarmReptTimes)
                  if (alarmKind==0)
                      mMessage=mMessage+"\n"+"next alarm :"+mClockSnooze[alarmRept]+" ";
                  else
                      mMessage=mMessage+"\n"+"next alarm:"+AlarmGloble.rept[alarmRept]+" ";
  
          }
  
      }
  
      textViewMessage.setText(mMessage);
  
  
      if(mMp3.equals(AlarmGloble.RANDOM)){
          File file=new File(AlarmGloble.ROOT_MUSIC);
          RandomMp3 rm=new RandomMp3(file);
          if (rm.getCount()&gt;0)
              mMp3=rm.getFile();
          else
              mMp3="";
  
      }
      else {
          if(mMp3.equals(AlarmGloble.DEFAULT)){
              mMp3=getDefaultMP3();
          }
          else{
              String[] s=mMp3.split("/");
              textViewSongName.setText(s[s.length-1]);
          }
      }
  
      if (mMp3.equals("")){
          textViewSongName.setText(mMp3);
      }
      else {
          String[] s=mMp3.split("/");
          textViewSongName.setText(s[s.length-1]);
      }
      (LinearLayout)findViewById(R.id.alarm_alertLinearLayoutButtons);
      linearLayoutButtons.requestFocus();
  }
  </code></pre>
  
  <p>here is alarm_alert.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:orientation="vertical"
  android:id="@+id/linearLayoutAlarmAlert" &gt;
  
  &lt;LinearLayout
      android:id="@+id/alarm_alertLinearLayoutButtons"
      android:layout_width="match_parent"
      android:layout_height="wrap_content" &gt;
  
      &lt;Button
          android:id="@+id/alarm_alertButtonClose"
          style="@style/Button"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="@string/btnClose" /&gt;
  
      &lt;Button
          android:id="@+id/alarm_alertButtonEdit"
          style="@style/Button"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="@string/btnEdit"
          android:visibility="visible" /&gt;
  
      &lt;Button
          android:id="@+id/alarm_alertButtonDismiss"
          style="@style/Button"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="@string/btnExit"
          android:visibility="visible" /&gt;
  
  &lt;/LinearLayout&gt;
  
  &lt;LinearLayout
      android:layout_width="match_parent"
      android:layout_height="wrap_content" &gt;
  
      &lt;TextView
          android:id="@+id/alarm_alertTextViewSnooze"
          style="@style/RedLeft17sp"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="@string/snooze" /&gt;
  
      &lt;Spinner
          android:id="@+id/alarm_alertSpinnerSnooze"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_weight="1" /&gt;
  
  &lt;/LinearLayout&gt;
  
  &lt;TextView
      android:id="@+id/alarm_alertTextViewMessage"
      style="@style/YellowLeft17sp"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:text="@string/btnClose" /&gt;
  
  &lt;TextView
      android:id="@+id/alarm_alertTextViewSongName"
      style="@style/YellowLeft17sp"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:ellipsize="marquee"
      android:marqueeRepeatLimit="marquee_forever"
      android:text="@string/btnClose" /&gt;    
  &lt;/LinearLayout&gt;
  </code></pre>