2

着信画面に追加情報を追加したい。そのために、アプリでPHONE_STATEをチェックしており、RINGINGでアクティビティを呼び出しています。このアクティビティでは、以下のようにテキスト ビューを設定しています。

期待どおりに動作します。テキストが着信画面に追加されます。問題は次のとおりです。

私が自分の app にいる場合、つまり my app のビューにいる場合、着信があると、Android の着信ウィンドウが表示されて消えます。私のアプリウィンドウが一番上になり、着信ウィンドウを上書きするはずだったテキストビューも表示されます。

この動作を説明してください。どうすればこれを修正できますか?

super.onCreate(savedInstanceState);
Log.i(TAG,"oncreate");
getWindow().addFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL);
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.incomingcallscreen);
TextView name = (TextView)findViewById(R.id.textView1);
name.setText(getIntent().getExtras().getString("NAME"));
incomingCallActivityContext = this;

そしてレイアウトは

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="250dip"
        android:src="@drawable/icon"
        android:text="CALLER NAME"
        android:textSize="35sp"
        android:textColor="@color/WHITE"
        android:layout_gravity="center_horizontal"
        android:windowAnimationStyle="@android:style/Animation.Translucent"
        android:windowBackground="@android:color/transparent"
        android:windowIsTranslucent="true" />

</LinearLayout>
4

1 に答える 1