如何在android代码中获取正在运行的服务列表并通过短信发送SMSManager?
我正在开发一款Android应用.在该应用程序中,有一个按钮可以转到另一个活动,其中包含手机上已安装应用程序的列表.当用户选择应用程序时,将保存其包名称,并且用户将返回上一个活动.但是,我怎样才能获得包名?
public class LoaderCustomSupport extends SherlockFragmentActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
FragmentManager fm = getSupportFragmentManager();
// Create the list fragment and add it as our sole content.
if (fm.findFragmentById(android.R.id.content) == null) {
AppListFragment list = new AppListFragment();
fm.beginTransaction().add(android.R.id.content, list).commit();
}
}
/**
* This class holds the per-item data in our Loader.
*/
public static class AppEntry {
public AppEntry(AppListLoader loader, ApplicationInfo info) {
mLoader = loader;
mInfo = info;
mApkFile = new File(info.sourceDir);
}
public ApplicationInfo …Run Code Online (Sandbox Code Playgroud)