Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android 2-方创新1507064134 #45

Open
InnoFang opened this issue Jan 6, 2016 · 0 comments
Open

Android 2-方创新1507064134 #45

InnoFang opened this issue Jan 6, 2016 · 0 comments

Comments

@InnoFang
Copy link
Member

InnoFang commented Jan 6, 2016

在MainActivity.java下

public class MainActivitkjdshfksadf extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main_activity);
        Button button = (button) findIdByView(R.id.button_1);
        button.setOnClickListener(new View.OnClickListener(){
            Intent intent = new Intent(Intent.ACTION_VIEW);
            intent.setData(Uri.parse("http://www.baidu.com"));
            startActivity(intent);
        })

}

并在AndroidManifest.xml里注册

            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <data android:scheme="http:"/>
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant