自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

Android開發(fā)一些小功能的實現

移動開發(fā) Android
Android開發(fā)中一些常用的小功能實現,不算是技術,算是一個小總結。

今天分享一下在Android開發(fā)一些小功能的實現,遇到的一些問題與解決方法,希望能夠對大家有所幫助。

Toast(消息提示框):

  1. Toast.makeText(MainActivity.this, "位置改變了::::::::::::", 3000).show(); 

intent跳轉:(AndroidManifest.xml 中記得注冊 Activity)

  1. Intent intent=new Intent(Success.this,luru.class); 
  2. startActivity(intent); 

intent隱式啟動:

  1.  Intent intent=new Intent(Intent.ACTION_VIEW,Uri.parse(urlString)); 
  2. startActivity(intent); 
  3. urlString可以是"www.baidu.com"

系統(tǒng)獲取時間:

  1. Date now=new Date(); 
  2. //自定義格式 
  3. SimpleDateFormat d1=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); 
  4. String time=d1.format(now); 

相機的調用:

  1. String filepath = "/mnt/sdcard/DCIM/Camera/"+ phototime + ".png"
  2. final File file = new File(filepath); 
  3. final Uri imageuri = Uri.fromFile(file); 
  4. Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); 
  5. intent.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, imageuri); 
  6. startActivityForResult(intent, 110);

怎么樣,這篇Android開發(fā)一些小功能的實現里有你想要的么?

責任編輯:閆佳明 來源: my.eoe.cn
相關推薦

2015-08-27 11:16:14

ios開發(fā)技巧

2021-12-25 15:30:03

GNOME桌面應用

2013-04-09 11:26:55

WindowsPhon

2011-03-31 14:16:54

Cacti技巧

2013-07-24 17:45:24

Android開發(fā)學習Android常用小功

2020-11-25 07:43:07

Java

2017-02-28 10:54:40

Pandas

2021-06-18 07:35:46

Java接口應用

2009-04-29 23:04:44

破解還原卡還原精靈

2010-05-18 10:47:52

2016-05-13 17:24:00

java大數據

2020-10-08 18:56:17

Node.js命令行

2009-09-17 16:41:12

C#組件編程

2010-05-26 17:40:14

MySQL數據庫

2021-04-05 22:33:24

Windows 10Windows微軟

2020-10-28 10:36:42

分離數據庫性能

2018-04-25 13:12:12

編程程序員建議

2010-06-04 16:26:02

2021-11-11 15:24:24

手機電池充電

2020-05-22 13:32:24

可視化詞云圖數據
點贊
收藏

51CTO技術棧公眾號