我可以在点击按钮的Android项目上打开线性布局中的已安装应用程序吗
我可以在线性布局中打开第三方安装的应用程序吗 或者在框架布局中,单击按钮。我的意思是,我想要两个应用程序 同时。一个在顶部框架上,另一个在底部框架上 mainactivity.xml我可以在点击按钮的Android项目上打开线性布局中的已安装应用程序吗,android,Android,我可以在线性布局中打开第三方安装的应用程序吗 或者在框架布局中,单击按钮。我的意思是,我想要两个应用程序 同时。一个在顶部框架上,另一个在底部框架上 mainactivity.xml 在此项目中,我可以在我的应用程序之外打开应用程序,但无法在我的表布局内打开。是否存在以这种方式打开应用程序的编码?不,这是不可能的(可能是由于安卓系统的安全原因),谢谢您的评论。从逻辑上讲,我的感觉和你说的一样。但三星推出了支持多应用的手机。几年前,我使用了一个支持多应用程序开启器的应用程序witch。但我不确定是
在此项目中,我可以在我的应用程序之外打开应用程序,但无法在我的表布局内打开。是否存在以这种方式打开应用程序的编码?不,这是不可能的(可能是由于安卓系统的安全原因),谢谢您的评论。从逻辑上讲,我的感觉和你说的一样。但三星推出了支持多应用的手机。几年前,我使用了一个支持多应用程序开启器的应用程序witch。但我不确定是Android,可能是支持JAR的手机。当你使用的这个应用程序只能在三星设备上使用时,三星可能在C++中实现了这个应用程序。华硕也一样,他们证明了一个多应用程序开放程序,它是用C++实现的,而不是在java中提供这个功能。所以它不是一个本地Java应用程序。他们将应用程序与自己的设备一起提供,这些应用程序可能具有本地jana应用程序通常不具备的系统权限感谢您的信息。你的评论节省了我的时间。我要另寻出路。可能是使用kill应用程序或其他方法。
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/FrameLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.mulititask.MainActivity" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:text="some text" />
<Button
android:id="@+id/btnbrowser"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/textView1"
android:layout_toLeftOf="@+id/btnpdbreader"
android:text="open browser" />
<Button
android:id="@+id/btnpdbreader"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/btnbrowser"
android:layout_alignBottom="@+id/btnbrowser"
android:layout_alignParentRight="true"
android:text="open pdb reader" />
</RelativeLayout>
<TableLayout
android:id="@+id/tlayout"
android:layout_width="match_parent"
android:layout_height="265dp"
android:layout_gravity="bottom"
android:background="#991535" >
<TableRow
android:id="@+id/tableRow1"
android:layout_width="wrap_content"
android:layout_height="0dp" >
<Button
android:id="@+id/btnhide"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#000000"
android:text="hide this frame"
android:textColor="#ffffff" />
</TableRow>
<TableRow
android:id="@+id/tableRow2"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1" >
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="Open browser or pdb file viewer within this frame on default button click" />
</TableRow>
</TableLayout>
</FrameLayout>
package com.mulititask;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.view.View;
import android.widget.Button;
import android.widget.TableLayout;
public class MainActivity extends ActionBarActivity {
Button btnbrowser, btncalc, btnhideframe;
TableLayout tlayout;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
btnhideframe = (Button) findViewById(R.id.btnhide);
btnbrowser = (Button) findViewById(R.id.btnbrowser);
btncalc = (Button) findViewById(R.id.btnpdbreader);
tlayout = (TableLayout) findViewById(R.id.tlayout);
tlayout.setVisibility(View.GONE);
btnhideframe.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
tlayout.setVisibility(View.GONE);
}
});
btnbrowser.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
tlayout.setVisibility(View.VISIBLE);
Intent i;
PackageManager manager = getPackageManager();
try {
i = manager.getLaunchIntentForPackage("com.browser.ucweb");//"com.browser.ucweb" is not correct and thats not a problem. So leave it
if (i == null)
throw new PackageManager.NameNotFoundException();
i.addCategory(Intent.CATEGORY_LAUNCHER);
startActivity(i);
} catch (PackageManager.NameNotFoundException e) {
}
}
});
btncalc.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
tlayout.setVisibility(View.VISIBLE);
Intent i;
PackageManager manager = getPackageManager();
try {
i = manager.getLaunchIntentForPackage("com.calculator.default");//"com.calculator.default" is not correct and thats not a problem. So leave it
if (i == null)
throw new PackageManager.NameNotFoundException();
i.addCategory(Intent.CATEGORY_LAUNCHER);
startActivity(i);
} catch (PackageManager.NameNotFoundException e) {
}
}
});
}
}