首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

intent的非一般用法

2012-06-28 
intent的特殊用法public class Intents extends Activity { @Override protected void onCreate(Bundle sa

intent的特殊用法

public class Intents extends Activity {

@Override protected void onCreate(Bundle savedInstanceState)

{

super.onCreate(savedInstanceState);

?setContentView(R.layout.intents);

// Watch for button clicks. Button button = (Button)findViewById(R.id.get_music); button.setOnClickListener(mGetMusicListener);

}

private OnClickListener mGetMusicListener = new OnClickListener()

{

public void onClick(View v) {

?Intent intent = new Intent(Intent.ACTION_GET_CONTENT);

// 这儿的处理

?intent.setType("audio/*");

startActivity(Intent.createChooser(intent, "Select music"));

}

};

}

热点排行