I try to make sample application that show contact name and number from my local contacts when incoming call, every thing work correctly but my activity dialog didn't appear till call finished or terminated. I want to show this dialog like TrueCaller
Application popup when call started or find any result, My dialog started correctly when found any result but i can't show it until call finished. I cant run it on UI Thread my logic in non activity class. Any help ?
following code show how i start my activity
Intent intent = new Intent(ctx, MyDialog.class);
intent.putExtra(MyDialog.NUMBER, number);
intent.putExtra(MyDialog.CONTACT, name);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
ctx.startActivity(intent);
And i define my activity in mainfaist
file
<activity
android:name=".ui.MyDialog"
android:excludeFromRecents="true"
android:screenOrientation="portrait"
android:theme="@style/dialog_activity_style"/>