- 浏览: 688856 次
- 性别:
- 来自: 苏州
最新评论
-
usedlie:
if (flag) { matrix.set(matrix ...
android view的缩放平移简单实现 -
jin290:
简单 快捷 非常棒 可以直接用
android 应用实现微信好友或朋友圈分享 -
貌似掉线:
0是朋友1是朋友圈
android 应用实现微信好友或朋友圈分享 -
zhangzhanlei:
[color=red][/color]
android 应用实现微信好友或朋友圈分享 -
shizhangliao:
android适配多分辨率的小技巧
Main layout
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <LinearLayout android:layout_width="fill_parent" android:layout_height="50dip" android:gravity="center_vertical|center_horizontal"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="选择安装文件" /> </LinearLayout> <ListView android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/list" /> </LinearLayout>
Item Layout
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/item" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="80dip"> <LinearLayout android:layout_width="240dip" android:layout_height="40dip" android:gravity="left"> <TextView android:text="appName: " android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical" /> <TextView android:id="@+id/appname" android:layout_width="wrap_content" android:layout_height="wrap_content" android:maxLines="1" android:marqueeRepeatLimit="marquee_forever" android:ellipsize="marquee" android:maxWidth="100dip" android:layout_gravity="center_vertical" /> </LinearLayout> <LinearLayout android:layout_width="120dip" android:layout_height="40dip" android:layout_gravity="right"> <Button android:id="@+id/btn" android:layout_width="80dip" android:layout_height="40dip" android:text="打开" android:layout_gravity="center_vertical" /> </LinearLayout> </LinearLayout>
TestActivity
package com.nico; import java.util.List; import android.app.Activity; import android.content.Intent; import android.content.pm.ApplicationInfo; import android.os.Bundle; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.View.OnClickListener; import android.widget.BaseAdapter; import android.widget.Button; import android.widget.ListView; import android.widget.TextView; public class TestActivity extends Activity { public List<ApplicationInfo> applist = null; public ListView list = null; public LayoutInflater inflater = null; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); list = (ListView) findViewById(R.id.list); myAdapter madapter = new myAdapter(); inflater = getLayoutInflater(); applist = this.getPackageManager().getInstalledApplications(0); list.setAdapter(madapter); // getPackageManager().getInstalledPackages(0) } public class myAdapter extends BaseAdapter { @Override public int getCount() { // TODO Auto-generated method stub return applist.size(); } @Override public Object getItem(int position) { // TODO Auto-generated method stub return applist.get(position); } @Override public long getItemId(int position) { // TODO Auto-generated method stub return position; } @Override public View getView(final int position, View convertView, ViewGroup parent) { TextView txt = null; if (convertView != null) { txt = (TextView) convertView.findViewById(R.id.appname); txt.setText(applist.get(position).loadLabel( TestActivity.this.getPackageManager())); } else { convertView = inflater.inflate(R.layout.item, null); txt = (TextView) convertView.findViewById(R.id.appname); // Log.v("Test", // "2 "+applist.get(position).loadLabel(TestActivity.this.getPackageManager())); txt.setText(applist.get(position).loadLabel( TestActivity.this.getPackageManager())); } Button btn = (Button) convertView.findViewById(R.id.btn); btn.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { Intent intent = getPackageManager() .getLaunchIntentForPackage( applist.get(position).packageName); TestActivity.this.startActivity(intent); } }); return convertView; } } }
发表评论
-
jar包混淆
2016-09-18 16:46 1089开发过程中需要把相关功能打成jar包供别人调用,如果不混淆的话 ... -
项目从eclipse移植到studio中遇到的问题整理
2016-09-13 17:42 1138概念 eclipse workspace ---> ... -
ViewGroup&View&Activity onInterceptTouchEvent&dispatchTouchEvent&onTouch整理
2016-08-03 22:26 634一直对这块的知识一知 ... -
仿京东android客户端收件地址选择
2016-07-12 18:07 6477纯手写,可能有些问题,功能已实现 activity pac ... -
FragmentActivity中资源被回收,导致页面fragment错乱的问题
2016-06-07 13:59 3806开发过程中,页面使用fragmentactivity,可能会遇 ... -
android 通过eclipse mat来监测应用内存
2016-02-03 13:02 011dasdasdas -
【转】详解ViewPager调用FragmentPagerAdapter.notifyDataSetChanged()不能更新Fragment
2016-01-30 13:27 2014转载自 http://www.blog4app.com/?p= ... -
startActivityForResult常用使用方式
2015-04-24 11:58 1682示例 初始Activity启动目标activity,并带上了请 ... -
在android4.4以上版本 第三方应用处理短信的疑惑
2015-03-31 16:14 990最近有个处理android手机短信的需求,需要删除本地某指定短 ... -
Beacon的入门相关知识整理(关于android开发)
2014-10-27 16:53 0To do.... -
[转]常用Github项目类库
2014-09-18 09:29 1760【转自】http://blog.csdn.net/jabony ... -
android适配多分辨率的小技巧
2014-09-05 18:10 2766android多分辨率适配其实是老生常谈的话了,今天再拿出来炒 ... -
android通过自定义schame和host来启动app
2014-08-15 15:02 2128很多时候,我们可以看到在web页面中点击链接,可以直接启动ap ... -
基础知识整理
2014-08-08 17:50 0onTouch(MotionEvent event) eve ... -
android view的缩放平移简单实现
2014-07-22 16:20 16326参考了下网上一些实现 主要是通过matrix实现的 用到的 ... -
android 应用实现微信好友或朋友圈分享
2014-07-18 16:44 60391官方的文档连接:https://open.weixin.qq. ... -
android 自定义view支持gif格式播放
2014-07-16 18:38 4116前段时间做了个项目,有播放gif的需求, 而android展示 ... -
android中自定义attr,以及style杂谈
2014-06-05 18:12 13712attr 属性 style 样式 二者都是在res/value ... -
ViewGroup中的onInterceptTouchEvent和onTouchEvent调用时序
2014-05-20 11:20 1134最近在做android类似slidemenu项目,遇到了scr ... -
获取手机网络状态的代码
2014-03-27 16:45 1265之前网上有人使用方法判断手机网络状态代码如下: Co ...
相关推荐
安卓应用app启动,查看包名,版本号等源代码 列出所有手机安装的应用,读取包名版本,点击启动应用
查看APP信息,目前功能有: 1.APP启动器,列出可启动APP,点击启动 2.列出所有APP,点击显示大小信息 以后学到其他功能再补充!
Google Cardboard 应用启动器 Cardboard App Launcher 是一款 ... Cardboard App Launcher 尝试仅显示与 Google Cardboard 兼容的应用程序,但如果无法列出特定应用程序,用户可以在设置菜单中选择它。 当用户退出
说明:启动软件后,单击左上方的“Open folder”按钮,定位到包含UMD电子书的文件夹,此时会在左边的的“Files”窗口列出该文件夹内包含的所有UMD格式的电子书,点击一个UMD文件,左下方的“Chapters”窗口中即会...
react-admin() ...项目是用create-react-app创建的,主要还是列出新加的功能依赖包 点击名称可追溯相关网站 :grinning_face_with_smiling_eyes: :grinning_face_with_smiling_eyes: ( react,4.x的版
已放到GitHub启动和打包的时间都稍长,请耐心等待两分钟(已增加响应式,可手机预览:grinning_face_with_smiling_eyes:)依赖模块项目是用create-react-app创建的,主要还是列出新加的功能依赖包点击名称可跳转相关...
项目是用create-react-app创建的,主要还是列出新加的功能依赖包 点击名称可跳转相关网站:grinning_face_with_smiling_eyes::grinning_face_with_smiling_eyes: (react路由,4.x的差异还是比较大,暂时还是3.x的版本)...
项目是用create-react-app创建的,主要还是列出新加的功能依赖包 点击名称可跳转相关网站:grinning_face_with_smiling_eyes::grinning_face_with_smiling_eyes: (react路由,4.x的差异还是比较大,暂时还是3.x的版本)...
应确保连接成功(可运行 adb devices 看是否能列出该设备)。 让设备在 5555 端口监听 TCP/IP 连接: adb tcpip 5555 断开 USB 连接。 找到设备的 IP 地址。 一般能在「设置」-「关于手机」-「状态信息」-「IP...
两项宏观行为指标可反映出用户对app的依赖程度 如果留存较好,但时长和次数均不高,则可能是因过于强调每日登录奖励,但持续的app内容用户家缺乏吸引力所致 用户分析 用户规模 下载数量 新增用户 定义:每日...
使用间隔 平均多长时间启动/使用一次app 用户对app的依赖程度 各个时间段启动app人数分布 用户行为 短期点击行为、搜索行为、收藏行为 等级分析 各个等级平均耗时 用户成长速度 需要严格控制高端用户成长速度 各个...