Android Open Source - bin.calc_android Activity_app Info






From Project

Back to project page bin.calc_android.

License

The source code is released under:

GNU General Public License

If you think the Android project bin.calc_android 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 info.ohgita.android.bincalc;
/*from   w  w w . java2  s . c o m*/
import info.ohgita.bincalc_android.R;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.os.Bundle;
import android.view.WindowManager;
import android.webkit.WebView;
import android.widget.TextView;

import com.actionbarsherlock.app.SherlockActivity;
import com.actionbarsherlock.view.MenuItem;

public class Activity_appInfo extends SherlockActivity {
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
    setTheme(R.style.Theme_Sherlock_Light);
    setContentView(R.layout.activity_appinfo);
    
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    
    /* Load version */
    int version_code = 0;
    String version_name = "";
    try {
      PackageManager packageManager = this.getPackageManager();
      PackageInfo packageInfo = packageManager.getPackageInfo(this.getPackageName(), PackageManager.GET_ACTIVITIES);
      version_code = packageInfo.versionCode;
      version_name = packageInfo.versionName;
    } catch (NameNotFoundException e) {
      e.printStackTrace();
    }
    TextView tv_version = (TextView)this.findViewById(R.id.textView_binCalcVersion);
    tv_version.setText(version_name);
    
    /* load license-page to webView */
    WebView wv = (WebView)findViewById(R.id.webView_license);
    wv.loadUrl("file:///android_asset/license.html");
  }
  
  @Override  
  public boolean onOptionsItemSelected(MenuItem item) {  
    switch(item.getItemId()) {  
      case android.R.id.home:  
        finish();  
        return true;  
    }
    return super.onOptionsItemSelected(item);  
  }  
  
}




Java Source Code List

info.ohgita.android.bincalc.Activity_appInfo.java
info.ohgita.android.bincalc.Activity_main.java
info.ohgita.android.bincalc.Activity_preference.java
info.ohgita.android.bincalc.Adapter_BaseinputsViewPager.java
info.ohgita.android.bincalc.CalculatorBaseConvResult.java
info.ohgita.android.bincalc.CalculatorMemoryData.java
info.ohgita.android.bincalc.Calculator.java
info.ohgita.android.bincalc.Fragment_main.java
info.ohgita.android.bincalc.calculator.BaseConverterTest.java
info.ohgita.android.bincalc.calculator.BaseConverter.java
info.ohgita.android.bincalc.calculator.BasicArithOperator.java
info.ohgita.android.bincalc.calculator.ExpParserTest.java
info.ohgita.android.bincalc.calculator.ExpParser.java
info.ohgita.android.bincalc.calculator.HistoryItem.java