package com.cienet.testplugin.main;
import java.util.ArrayList;
import java.util.List;
import android.app.Activity;
import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.Button;
public class TestPluginMainAppActivity extends Activity {
private Button btn;
private List<PluginBean> plugin_list;
private ViewGroup currentView;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
currentView = (ViewGroup) LayoutInflater.from(this).inflate(
R.layout.main, null);
setContentView(currentView);
btn = (Button) findViewById(R.id.button1);
btn.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
plugin_list = scan4Plugins();
showInParent(plugin_list);
}
});
}
protected List<PluginBean> scan4Plugins() {
List<PluginBean> plugins = new ArrayList<PluginBean>();
PackageManager pm = getPackageManager();
List<PackageInfo> pi_list = pm
.getInstalledPackages(PackageManager.GET_UNINSTALLED_PACKAGES);
String sharedUID = "com.cienet.testplugin";
for (PackageInfo pi : pi_list) {
if (!pi.packageName.equals("com.cienet.testplugin.main")
&& sharedUID.equals(pi.sharedUserId)) {
PluginBean pbean = new PluginBean();
pbean.setLabel(pm.getApplicationLabel(pi.applicationInfo)
.toString());
pbean.setPackageName(pi.packageName);
plugins.add(pbean);
try {
Context context = createPackageContext("perfecter.skin01",
Context.CONTEXT_IGNORE_SECURITY);
Drawable drawable = context.getResources().getDrawable(
R.drawable.pic);
pbean.setPic(drawable);
} catch (NameNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
return plugins;
}
/**
* @param plugin_list
*
*/
protected void showInParent(List<PluginBean> plugin_list) {
for (final PluginBean bean : plugin_list) {
Button btn = new Button(this);
btn.setText(bean.getLabel());
currentView.addView(btn);
btn.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
currentView.setBackgroundDrawable(bean.getPic());
}
});
}
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
换肤 更换软件主题(apk方式)(程序源码).rar
共67个文件
png:20个
class:15个
java:6个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 45 浏览量
2023-03-17
08:26:42
上传
评论
收藏 3.32MB RAR 举报
温馨提示
免责声明:资料部分来源于合法的互联网渠道收集和整理,部分自己学习积累成果,供大家学习参考与交流。收取的费用仅用于收集和整理资料耗费时间的酬劳。 本人尊重原创作者或出版方,资料版权归原作者或出版方所有,本人不对所涉及的版权问题或内容负法律责任。如有侵权,请举报或通知本人删除。
资源推荐
资源详情
资源评论
收起资源包目录
换肤 更换软件主题(apk方式)(程序源码).rar (67个子文件)
更换软件主题(apk方式)
Skin01
project.properties 361B
.classpath 433B
.settings
org.eclipse.jdt.core.prefs 214B
res
drawable-hdpi
pic.png 651KB
ic_launcher.png 4KB
bin
classes
perfecter
skin01
BuildConfig.class 341B
R$attr.class 334B
R$drawable.class 428B
R.class 381B
resources.ap_ 657KB
jarlist.cache 120B
res
drawable-mdpi
ic_launcher.png 2KB
drawable-ldpi
ic_launcher.png 2KB
crunch
drawable-mdpi
drawable-ldpi
drawable-hdpi
pic.png 652KB
ic_launcher.png 4KB
drawable-hdpi
pic.png 652KB
ic_launcher.png 4KB
classes.dex 1KB
Skin01.apk 660KB
dexedLibs
AndroidManifest.xml 520B
proguard.cfg 1KB
.project 842B
AndroidManifest.xml 520B
gen
perfecter
skin01
BuildConfig.java 158B
R.java 445B
TestPluginMainApp
project.properties 361B
.classpath 475B
.settings
org.eclipse.jdt.core.prefs 635B
org.eclipse.core.resources.prefs 158B
assets
src
com
cienet
testplugin
main
TestPluginMainAppActivity.java 2KB
PluginBean.java 854B
res
drawable-mdpi
ic_launcher.png 3KB
drawable-xhdpi
drawable-ldpi
ic_launcher.png 2KB
values
strings.xml 200B
layout
main.xml 429B
drawable-hdpi
pic.png 4KB
ic_launcher.png 4KB
bin
classes
com
cienet
testplugin
main
R$string.class 451B
R$layout.class 418B
PluginBean.class 1KB
TestPluginMainAppActivity.class 5KB
R$id.class 409B
TestPluginMainAppActivity$1.class 1KB
BuildConfig.class 361B
R$attr.class 364B
R$drawable.class 458B
R.class 587B
TestPluginMainAppActivity$2.class 1KB
resources.ap_ 15KB
jarlist.cache 120B
res
drawable-mdpi
ic_launcher.png 2KB
drawable-ldpi
ic_launcher.png 2KB
crunch
drawable-mdpi
ic_launcher.png 2KB
drawable-ldpi
ic_launcher.png 2KB
drawable-hdpi
pic.png 4KB
ic_launcher.png 4KB
drawable-hdpi
pic.png 4KB
ic_launcher.png 4KB
TestPluginMainAppActivity.apk 19KB
TestPluginMainApp.apk 20KB
classes.dex 7KB
dexedLibs
AndroidManifest.xml 805B
proguard.cfg 1KB
.project 853B
AndroidManifest.xml 805B
gen
com
cienet
testplugin
main
BuildConfig.java 168B
R.java 800B
共 67 条
- 1
资源评论
金枝玉叶9
- 粉丝: 138
- 资源: 7640
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功