这是我的旧代码
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button web = (Button) findViewById(R.id.button1);
web.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent();
// set data
intent.setData(Uri.parse("http://apps.samsung.com/mars/appquery/appDetail.as?appId=com.example.hi"));
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_INCLUDE_STOPPED_PACKAGES);
startActivity(intent);
}
});
}
我希望当我点击网页上的按钮时,能够直接打开三星商店这个应用程序,而不是通过浏览器打开。