android状态栏加ImageView
来源:互联网 发布:vb如何隐藏控件菜单栏 编辑:程序博客网 时间:2024/05/16 08:29
\android4.0\frameworks\base\packages\SystemUI\src\com\android\systemui\statusbar\tablet
定义 ImageView switchbutton;
switchbutton= (ImageView)sb.findViewById(R.id.swilanucher);
switchbutton.setOnClickListener(new OnClickListener(){
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
Log.e(TAG,"click by pcc+++++++++++++++++++++++++++");
}
});
\android4.0\frameworks\base\packages\SystemUI\res\layout-sw600dp
/>
<com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/recent_apps"
android:layout_width="80dip"
android:layout_height="match_parent"
android:src="@drawable/ic_sysbar_recent"
android:contentDescription="@string/accessibility_recent"
systemui:glowBackground="@drawable/ic_sysbar_highlight"
/>
<ImageView
android:id="@+id/swilanucher"
android:layout_width="80dip"
android:layout_height="wrap_content"
android:src="@drawable/statusbar_bh"
/>
<com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/volume_down"
android:layout_width="80dip"
android:layout_height="match_parent"
android:src="@drawable/ic_sysbar_volume_down"
systemui:keyCode="25"
systemui:glowBackground="@drawable/ic_sysbar_highlight"
android:visibility="gone"
/>
<com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/volume_up"
android:layout_width="80dip"
android:layout_height="match_parent"
android:src="@drawable/ic_sysbar_volume_up"
systemui:keyCode="24"
systemui:glowBackground="@drawable/ic_sysbar_highlight"
android:visibility="gone"
/>
图片资源:
\android4.0\frameworks\base\packages\SystemUI\res\drawable-sw600dp-mdpi
设置默认launcher 并启动:
import android.app.ActivityThread;
import android.content.pm.IPackageManager;
switchbutton.setOnClickListener(new OnClickListener(){
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
Log.e(TAG,"click by pcc+++++++++++++++++++++++++++");
//Intent intents = new Intent(Intent.ACTION_MAIN, null);
/*intents.addCategory(Intent.CATEGORY_HOME);
intents.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK
| Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
ComponentName component = new ComponentName("com.mofing", "com.mofing.mos.QtActivity");//packageName:第三方应用程序的包名,className第三方应用程序的类名
intents.setComponent(component);
startActivityForResult(intents, 1);
startActivity(intents);
intents.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);*/
IPackageManager pm = ActivityThread.getPackageManager();
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_HOME);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
List<ResolveInfo> list = new ArrayList<ResolveInfo>();
try {
list = pm.queryIntentActivities(intent,
intent.resolveTypeIfNeeded(mContext.getContentResolver()),
PackageManager.MATCH_DEFAULT_ONLY);
}catch (RemoteException e) {
throw new RuntimeException("Package manager has died", e);
}
// get all components and the best match
IntentFilter filter = new IntentFilter();
filter.addAction(Intent.ACTION_MAIN);
filter.addCategory(Intent.CATEGORY_HOME);
filter.addCategory(Intent.CATEGORY_DEFAULT);
final int N = list.size();
ComponentName[] set = new ComponentName[N];
int bestMatch = 0;
for (int i = 0; i < N; i++) {
ResolveInfo r = list.get(i);
set[i] = new ComponentName(r.activityInfo.packageName,
r.activityInfo.name);
if (r.match > bestMatch) bestMatch = r.match;
}
// add the default launcher as the preferred launcher
ComponentName launcher = new ComponentName("com.mofing", "com.mofing.mos.QtActivity");
try {
pm.addPreferredActivity(filter, bestMatch, set, launcher);
} catch (RemoteException e) {
throw new RuntimeException("Package manager has died", e);
}
context.startActivity(intent);
}
});
- android状态栏加ImageView
- Android ImageView 加边框
- Android ImageView加边框
- Android - ImageView 加边框 实例
- Android兑现ImageView加边框
- android ImageView 加边框, 加阴影,shadow
- Android之给ImageView加文字
- Android之最简单的ImageView加边框方法
- Android之最简单的ImageView加边框方法
- Android之最简单的ImageView加边框方法
- Android最简单的Imageview加边框的方法
- Storyboard imageview 加tableview
- ImageView加边框
- 给对话框加状态栏
- 给对话框加状态栏
- 状态栏上加时间
- android-ImageView
- android imageview
- UFLDL教程 -- 译文版
- 周流水0714——回帝都办离职后续(公积金+养老金+会计证调出)
- Binary Tree Level Order Traversal
- java连接mysql数据库乱码的解决方案
- sharepoint 2010 在自定义列表的字段上增加功能菜单
- android状态栏加ImageView
- c3p0配置详解
- 开始写博客:记录学习、工作、生活!
- 怎样打印long long型数
- ipa上传到APP store
- Java语法基础之语句—for练习
- SQLite for Android
- 使用PCAP创建你的sniffer
- 在深圳,所谓的.Net开发牛人是掌握这些技术的,视微软技术如粪土啊