示例#1
0
  @Override
  public void onCreate(Bundle savedInstanceState) {
    Log.d("DemoAppActivity", "onCreate()...");

    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    // Settings
    Button okButton = (Button) findViewById(R.id.btn_settings);
    okButton.setOnClickListener(
        new View.OnClickListener() {
          public void onClick(View view) {
            ServiceManager.viewNotificationSettings(DemoAppActivity.this);
          }
        });

    Button sendButton = (Button) findViewById(R.id.send);
    sendButton.setOnClickListener(
        new View.OnClickListener() {
          public void onClick(View view) {
            if (xmppManager == null) {
              xmppManager = new XmppManagerex(DemoAppActivity.this);
            }
            EditText EditText = (EditText) findViewById(R.id.massage);
            xmppManager.send(EditText.getText().toString());
          }
        });
    // Start the service
    ServiceManager serviceManager = new ServiceManager(this);
    serviceManager.setNotificationIcon(R.drawable.notification);
    serviceManager.startService();
  }
  @Override
  public void onCreate(Bundle savedInstanceState) {
    Log.d("DemoAppActivity", "onCreate()...");

    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    // Settings
    Button okButton = (Button) findViewById(R.id.btn_settings);
    okButton.setOnClickListener(
        new View.OnClickListener() {
          public void onClick(View view) {
            ServiceManager.viewNotificationSettings(DemoAppActivity.this);
          }
        });

    // Start the service
    ServiceManager serviceManager = new ServiceManager(this);
    serviceManager.setNotificationIcon(R.drawable.notification);
    serviceManager.startService();
  }