switch(keyCode) {
//*/add number dialpad
case KeyEvent.KEYCODE_0:
case KeyEvent.KEYCODE_1:
case KeyEvent.KEYCODE_2:
case KeyEvent.KEYCODE_3:
case KeyEvent.KEYCODE_4:
case KeyEvent.KEYCODE_5:
case KeyEvent.KEYCODE_6:
case KeyEvent.KEYCODE_7:
case KeyEvent.KEYCODE_8:
case KeyEvent.KEYCODE_9:{
//case KeyEvent.KEYCODE_STAR:
//case KeyEvent.KEYCODE_POUND:
if("com.freeme.factory.input.KeyboardTest".equals(getCurrentActivityName())){
break;
} else if (getCurrentActivityName().contains("com.freeme.factory")) {
return 0;
}
if (keyCode == KeyEvent.KEYCODE_0) {
dialStr = "0";
}
if (keyCode == KeyEvent.KEYCODE_1) {
dialStr = "1";
}
if (keyCode == KeyEvent.KEYCODE_2) {
dialStr = "2";
}
if (keyCode == KeyEvent.KEYCODE_3) {
dialStr = "3";
}
if (keyCode == KeyEvent.KEYCODE_4) {
dialStr = "4";
}
if (keyCode == KeyEvent.KEYCODE_5) {
dialStr = "5";
}
if (keyCode == KeyEvent.KEYCODE_6) {
dialStr = "6";
}
if (keyCode == KeyEvent.KEYCODE_7) {
dialStr = "7";
}
if (keyCode == KeyEvent.KEYCODE_8) {
dialStr = "8";
}
if (keyCode == KeyEvent.KEYCODE_9) {
dialStr = "9";
}
if (keyCode == KeyEvent.KEYCODE_STAR) {
dialStr = "*";
}
if (keyCode == KeyEvent.KEYCODE_POUND) {
dialStr = "#";
}
if(getCurrentActivityName().contains("com.android.launcher3") ){
if (down && event.getRepeatCount() == 0) {
Intent DialIntent = new Intent(Intent.ACTION_DIAL,Uri.parse("tel:"+dialStr));
DialIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK );
mContext.startActivity(DialIntent);
}
}
break;
}