Skip to content

Commit 9328b13

Browse files
Fixed USSD Bug 2
1 parent 09d520c commit 9328b13

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

app/src/main/java/com/bald/uriah/baldphone/activities/DialerActivity.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,7 @@ public class DialerActivity extends BaldActivity {
7373
public static void call(final CharSequence number, final Context context) {
7474
if (ActivityCompat.checkSelfPermission(context, Manifest.permission.CALL_PHONE) == PackageManager.PERMISSION_GRANTED) {
7575
try {
76-
final CharSequence finalNumber = // In order to handle USSD
77-
(number.charAt(number.length() - 1) == '#') ?
78-
number.subSequence(0, number.length() - 1) + Uri.encode("#") : number;
79-
80-
context.startActivity(new Intent(Intent.ACTION_CALL).setData(Uri.parse("tel:" + finalNumber)));
76+
context.startActivity(new Intent(Intent.ACTION_CALL).setData(Uri.parse(("tel:" + number).replace("#", Uri.encode("#")))));
8177
} catch (SecurityException e) {
8278
Log.e(TAG, e.getMessage());
8379
e.printStackTrace();

0 commit comments

Comments
 (0)