Android Open Source - cmcc Main Activity






From Project

Back to project page cmcc.

License

The source code is released under:

Apache License

If you think the Android project cmcc listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package net.gongmingqm10.cmcc.activity;
//w ww  .jav  a2s  .  com
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.webkit.WebView;

import net.gongmingqm10.cmcc.R;

import butterknife.ButterKnife;
import butterknife.InjectView;
import cn.jpush.android.api.InstrumentedActivity;


public class MainActivity extends InstrumentedActivity {

    @InjectView(R.id.webView)
    WebView webView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ButterKnife.inject(this);
        init();
    }

    private void init() {
        webView.getSettings().setJavaScriptEnabled(true);
        webView.loadUrl("http://www.baidu.com/");
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        int id = item.getItemId();
        if (id == R.id.action_settings) {
            return true;
        }
        return super.onOptionsItemSelected(item);
    }
}




Java Source Code List

net.gongmingqm10.cmcc.ApplicationTest.java
net.gongmingqm10.cmcc.MainActivity.java
net.gongmingqm10.cmcc.activity.BillActivity.java
net.gongmingqm10.cmcc.activity.CMCCApplication.java
net.gongmingqm10.cmcc.activity.MainActivity.java
net.gongmingqm10.cmcc.activity.RouterActivity.java
net.gongmingqm10.cmcc.jpush.JPushReceiver.java
net.gongmingqm10.cmcc.jpush.JPushUtils.java
net.gongmingqm10.cmcc.utils.Constant.java