Skip to main content

Posts

Showing posts with the label calculator

How to Open Calculator In ANDROID

If we want to open the inbuilt calculator of ANDROID ,here is the sniffet... public class CalculatorActivity extends Activity { public static final String CALCULATOR_PACKAGE ="com.android.calculator2"; public static final String CALCULATOR_CLASS ="com.android.calculator2.Calculator"; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Intent calculatorintent = new Intent(); calculatorintent.setAction(Intent.ACTION_MAIN); calculatorintent.addCategory(Intent.CATEGORY_LAUNCHER); calculatorintent.setComponent(new ComponentName(CALCULATOR_PACKAGE,CALCULATOR_CLASS)); CalculatorActivity.this.startActivity(calculatorintent); } } The above may not work with every devices, so you may need this one.. ArrayList<HashMap<String,Object>> items =new ArrayList<HashMap<String...