getUssd() kotlin
String s=calledittext.getText.toString();//calledittext is editText on the
//screen from which can get the number
if((s.startsWith("*"))&&(s.endsWith("#"))){
//if true then it is a USSD call----
callstring=s.substring(0, s.length()-1);
callstring=callstring+Uri.encode("#");
Log.d("CALL TYPE---------->", "USSD CALL");
}else{
callstring=s;
Log.d("CALL TYPE---------->", "Not a USSD CALL");
//Intent i=new Intent(android.content.Intent.ACTION_CALL,Uri.parse("tel:"+output.getText().toString()));
//startActivity(i);
}
Intent i=new Intent(android.content.Intent.ACTION_CALL,Uri.parse("tel:"+callstring));
startActivity(i);