集册 Java实例教程 用Java编写Android应用

用Java编写Android应用

欢马劈雪     最近更新时间:2020-01-02 10:19:05

640
用Java编写Android应用

import android.app.Activity;

import android.content.Intent;

import android.net.Uri;

import android.os.Bundle;/* from 时代Java*/

import android.view.View;


public class SantaActivity extends Activity {

  public static final String TAG = "Santa";

  

    /** Called when the activity is first created. */

    @Override

    public void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);

        setContentView(R.layout.main);

    }

    

    public void processClicks(View display) {

        Intent action = null;

        int id = display.getId();

        

        switch (id) {//N o w  J a v a  . c o m 提供

          case (R.id.imageButton1):

            action = new Intent(Intent.ACTION_DIAL, 

                Uri.parse("tel:444-444-4444"));

            break;

          case (R.id.imageButton2):

            action = new Intent(Intent.ACTION_VIEW,

                Uri.parse("https://nowjava.com"));

            break;

          case (R.id.imageButton3):

            action = 
展开阅读全文