AlertActivity.java :  » Network » linkdn » org » freetek » linkdn » activity » alert » Android Open Source

Android Open Source » Network » linkdn 
linkdn » org » freetek » linkdn » activity » alert » AlertActivity.java
package org.freetek.linkdn.activity.alert;

import org.freetek.linkdn.LinkdnActivity;
import org.freetek.linkdn.R;

import android.os.Bundle;
import android.widget.TextView;

public class AlertActivity extends LinkdnActivity {

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.alert);
    
    TextView tvText = (TextView) findViewById(R.id.tvAlertText);
    tvText.setText(getMsg());
  }

  private String getMsg() {
    Bundle result = getExtras();
    
    if (!result.containsKey(AlertBundleKeys.MESSAGE)) {
      throw new IllegalArgumentException("extras bundle does not contain " + AlertBundleKeys.MESSAGE + " key");
    }
    return result.getString(AlertBundleKeys.MESSAGE);
  }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.