Header

  1. View current page

    zelon님의 노트

Profile_img_60x60_08
zelon 의 스프링노트입니다. 프로그래밍과 게임에 관한 노트입니다.
16

Android 안드로이드

특정 url 을 웹 브라우저에서 열기

  1. Button testButton = (Button)findViewById(R.id.Button01);
           
    testButton.setOnClickListener(new View.OnClickListener()
    {
        @Override
        public void onClick(View v)
        {
            Uri uri = Uri.parse("http://blog.wimy.com");
        Intent intent = new Intent(Intent.ACTION_VIEW, uri);
            startActivity(intent);
        }
    });

 

현재 화면에 웹 브라우저 embed 하기

  • layout 에 WebView 를 추가한다.
  • 코드에 import android.webkit.WebView 한다.

 

 

 

 

잠시 뜨는 팝업(Toast message) 보여주기

  1. Context context = getApplicationContext();

    CharSequence text = "Happy new year!";
    int duration = Toast.LENGTH_SHORT;

    Toast toast = Toast.makeText(context, text, duration);
    toast.show();

 

가로/세로 화면 전환하기

 - Ctrl + F11 을 누르면, 화면이 전환되며, activity 의 소멸 및 생성이 다시 이루어진다.

 

트랙볼 에뮬레이터

  • 에뮬레이터에서 Delete 키 누르고 마우스를 움직이자.

 

다른 Activity 띄우기

  1. Intent i = new Intent(this, newActivity.class);
  2. startActivity(i);

 

링크들

History

Last edited on 12/29/2009 01:14 by zelon

Comments (0)

You must log in to leave a comment. Please sign in.