I want my app to display a picture, when an incoming call happens.
What I did so far is to catch
the phone state
.
My question is how can I now put an image on the foreground of the dialer?
Here is my snippet:
public class reviever extends BroadcastReceiver{
@Override
public void onReceive(Context context, Intent intent) {
Log.d("TAG", "phone is ringing");
new Thread() {
public void run() {
try {
sleep(2000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}.start();
Intent toPop = new Intent(context, PicPop.class);
toPop.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(toPop);
}}
manifest:
<activity
android:name=".PicPop"
android:theme="@android:style/Theme.Translucent">
</activity>
my problem now is that all looks nice, i have a small picture on top of the stock dialer, and the background is translucent, but i cant answer the call. how can i change it so the picture will stay on top of the dialer but have an interaction with the dialer so to answer a call?
I found a way. you only need to make the background of the activity transparent `android:theme="@android:style/Theme.Translucent.NoTitleBar" and declare the activity not touchable and show when locked:
thanks you all any way.