-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: open app to show number of the incoming call
- Loading branch information
1 parent
7c4a43b
commit 2d69e86
Showing
6 changed files
with
91 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
app/src/main/java/com/shreekaram/calllogger/IncomingCallActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package com.shreekaram.calllogger; | ||
|
||
import android.annotation.SuppressLint; | ||
import android.app.Activity; | ||
import android.os.Bundle; | ||
import android.util.Log; | ||
import android.view.WindowManager; | ||
import android.widget.TextView; | ||
|
||
//https://www.quora.com/How-do-I-add-a-popup-window-over-an-Android-native-incoming-call-screen-like-the-Truecaller-Android-app | ||
|
||
public class IncomingCallActivity extends Activity { | ||
@SuppressLint("SetTextI18n") | ||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
try { | ||
Log.d("IncomingCallActivity: onCreate: ", "flag2"); | ||
// TODO Auto-generated method stub | ||
super.onCreate(savedInstanceState); | ||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE); | ||
getWindow().addFlags( | ||
WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL); | ||
Log.d("IncomingCallActivity: onCreate: ", "flagy"); | ||
setContentView(R.layout.activity_incoming_call); | ||
Log.d("IncomingCallActivity: onCreate: ", "flagz"); | ||
String number = getIntent().getStringExtra("incomingNumber"); | ||
@SuppressLint({"MissingInflatedId", "LocalSuppress"}) | ||
TextView text = findViewById(R.id.callText); | ||
text.setText("call with " + number); | ||
} catch (Exception e) { | ||
Log.d("Exception", e.toString()); | ||
// TODO Auto-generated catch block | ||
e.printStackTrace(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:orientation="vertical" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:background="@color/white" | ||
> | ||
<TextView | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:id="@+id/callText" | ||
android:textSize="30sp" | ||
/> | ||
|
||
</LinearLayout> |