上一页 1 ··· 5 6 7 8 9 10 下一页
  2013年7月18日
摘要: 1 public class MainActivity extends Activity { 2 public void onCreate(Bundle savedInstanceState) { 3 super.onCreate(savedInstanceState); 4 setContentView(R.layout.main); 5 //通过this.getSharedPreferences(保存的文件名字,以及访问的模式) 6 final SharedPreferences shared=this.getSha... 阅读全文
posted @ 2013-07-18 18:19 I love Android 阅读(282) 评论(0) 推荐(0) 编辑
摘要: 1 PopupWindow 需要一个自定义的布局文件 2 列如:popupwindow.xml 3 4 5 10 17 18 25 26 33 34 35 36 LayoutInflater flater=LayoutInflater.from(context);37 View popview=flater.inflate(R.layout.popuwindow, null);38 PopupWindow popup=new PopupWindow(popview, 200, 130,true);39 第一个参数:是自定义的布局文件40 第二、三个参数:显示的宽、... 阅读全文
posted @ 2013-07-18 18:16 I love Android 阅读(360) 评论(0) 推荐(0) 编辑
摘要: 1 //获取系统中已经安装的应用程序 2 List packageinfos=this.getPackageManager().getInstalledPackages(PackageManager.GET_UNINSTALLED_PACKAGES); 3 String packageName=packageInfos.get(positions).packageName;//得到应用程序的包名 4 5 int version=packageInfos.get(positions).versionCode;//版本号 6 7 String versionName=packageInfos... 阅读全文
posted @ 2013-07-18 18:10 I love Android 阅读(235) 评论(0) 推荐(0) 编辑
摘要: 1 1. public class ListFiles extends Activity 2 { 3 ListView Listview=null; 4 protected void onCreate(Bundle savedInstanceState) 5 { 6 super.onCreate(savedInstanceState); 7 super.setContentView(R.layout.files); 8 Listview=(ListView) super.findViewById(R.i... 阅读全文
posted @ 2013-07-18 18:07 I love Android 阅读(1704) 评论(0) 推荐(0) 编辑
摘要: 1 1.listview的数据填充可以通过ArrayAdapter,SimpleAdapter,也可以是一个xml文件,但是ArrayAdapter与SimpleAdapter的区别是: 2 ArrayAdapter可以让一个类继承自BaseAdapter之后,可以对listview中的button,checkBox等空间进行事件的监听操作,而SimpleAdapter只能对listview填充数据的一个操作,不具有对空间的事件监听功能。 3 下面通过实例进行说明(是通过自定义listview): 4 (1)SimpleAdapter: 5 listview中每一项中的数据的... 阅读全文
posted @ 2013-07-18 18:01 I love Android 阅读(632) 评论(0) 推荐(0) 编辑
摘要: 1./以下是常用到的Intent的URI及其示例,包含了大部分应用中用到的共用Intent。//一、打开一个网页,类别是Intent.ACTION_VIEWUri uri = Uri.parse(“http://blog.3gstdy.com/”);Intent intent = new Intent(Intent.ACTION_VIEW, uri);//二、打开地图并定位到一个点Uri uri = Uri.parse(“geo:52.76,-79.0342″);Intent intent = new Intent(Intent.ACTION_VIEW, uri);//三、打开拨号界面 ,类型 阅读全文
posted @ 2013-07-18 17:55 I love Android 阅读(216) 评论(0) 推荐(0) 编辑
摘要: 1 public class MainActivity extends Activity 2 { 3 int width,height; 4 private GameView gameview; 5 private Canvas canvas; 6 private Bitmap map; 7 private Paint paint; 8 public Path path; 9 private int color,pen; 10 private boolean isclear=true; 11 @SuppressWarnings("deprecati... 阅读全文
posted @ 2013-07-18 17:53 I love Android 阅读(523) 评论(0) 推荐(0) 编辑
摘要: 1 1.AudioManager audio=(AudioManager) super.getSystemService(Context.AUDIO_SERVICE);//获得手机的声音服务 2 3 //设置加音量 4 audio.adjustStreamVolume(AudioManager.FLAG_PLAY_SOUND, a++,AudioManager.FLAG_SHOW_UI); 5 第一个参数,代表使用声音服务的类型,第二个参数:是当前的音量值,第三个参数是:显示音量条 6 7 //减音量 8 audio.adjustS... 阅读全文
posted @ 2013-07-18 17:51 I love Android 阅读(538) 评论(0) 推荐(0) 编辑
摘要: 测试类至于要把一个类继承ActivityTestCase即可至于方法,根据需要自己建立方法;之后必须配置AnroidMainfest.xml文件 配置AndroidManifest.xml文件 1) 说明:与位置同级 2) 说明:与标签同级,targetPackage属性与上面mainfest的package属性内容相同即可 --> 阅读全文
posted @ 2013-07-18 17:48 I love Android 阅读(638) 评论(0) 推荐(0) 编辑
摘要: 1.主Activity 1 public class MainActivity extends Activity { 2 3 private ListView listView; 4 private ArrayList persons; 5 private ListAdapter adapter; 6 private Handler handler=null; 7 //xml文件的网络地址 8 final String path="http://192.168.5.10:8080/FileServer/person.xml"; 9 @S... 阅读全文
posted @ 2013-07-18 17:32 I love Android 阅读(961) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 下一页