Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8948535
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:01:03+00:00 2026-06-15T13:01:03+00:00

I have make an app that can show missed call when screen is locked,but

  • 0

I have make an app that can show missed call when screen is locked,but I don’t know how to show number of missed call on the locked screen.the call image is from MultiWaveViewwhich has defined already,I have trid using OnDraw,with Canvas and paint,draw the specify coordinate.but it doesn’t work .so anyone help me?thanks a lot.

image

how to show the number(e.g.in picture is position 2 )in the picutre?

edit1

for now I have get the right number of missed call in app,but it doesn’t show correctly

class:

framework\base\core\java\com\android\internal\widget\multiwaveview\MissedCallView.java

public class MissedCallView extends View {

private static final String TAG = "MissedCallViews";

public static final int UPDATESTART = 10;

private static final int DELAYTIME = 10000;

private int sTempMissedCallCount=-1;

Context mContext;

Canvas mCanvas;

public MissedCallView(Context context) 
{

super(context);

Log.i(TAG, "MissedCallView1");

mCanvas=new Canvas();

}

public MissedCallView(Context context, AttributeSet attrs)
{ 
super(context, attrs);

Log.i(TAG, "MissedCallView2");

mCanvas=new Canvas();

}

public MissedCallView(Context context,int missedCallNum) {

super(context);

sTempMissedCallCount=missedCallNum;

Log.i(TAG, "MissedCallView3");

mCanvas=new Canvas();

}

@Override 
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);

if(sTempMissedCallCount>0)

{

Paint paint=new Paint(Paint.ANTIALIASFLAG); 
paint.setColor(Color.RED); Log.i(TAG,"Integer.toString(sTempMissedCallCount)is:"+Integer.toString(sTempMissedCallCount)); canvas.drawText(Integer.toString(sTempMissedCallCount),40,310,paint);//50 invalidate();

Log.i(TAG, "invalidate");

}

}

}

this is the custom view ,Only MissedCallView(Context context,int missedCallNum) works ,it called at public class MissCallObserver extends ContentObserver when listen the missed called number .but the onDraw doesn’t work ,so the app doesn’t show the number I have got.

EDIT2:

for now I call the function in my custom hanlder, handler do every 10 second

private final Handler mUpdateMissCallNum = new Handler() {
@Override
public void handleMessage(Message msg) {
Log.i(TAG, "mUpdateMissCallNum");
switch (msg.what) {
case UPDATESTART:

Log.i(TAG, "UPDATESTART");
sNewMissedCallCount = getMissedCallCount(mContext);
if (sNewMissedCallCount != sTempMissedCallCount)
{

Log.i(TAG, "sNewMissedCallCount != sTempMissedCallCount");
new Thread(new Runnable()
{
public void run()
{

Log.i(TAG, "sNewMissedCallCount is:"+sNewMissedCallCount);

Log.i(TAG, "sTempMissedCallCount is:"+sTempMissedCallCount);
sTempMissedCallCount = sNewMissedCallCount;
mMissedCallView=new MissedCallView(mContext,sTempMissedCallCount);
//call my costum view here
Log.i(TAG, "sTempMissedCallCount is:"+sTempMissedCallCount);
        }
        }
    ).start();
    }
    break;
    default:
    break;
    }
}
}

I draw it with canvas and paint,without XML files

then I lock screen in XML:Keyguardscreentabunlock.xml (framework\base\core\res\res\layout).

which is use Ripple Lock in system:

<com.android.internal.widget.multiwaveview.MultiWaveView
android:id="@+id/unlockwidget"
android:orientation="horizontal"
android:layoutwidth="matchparent"
android:layoutheight="matchparent"
android:layout_alignParentBottom="true"
        android:targetDrawables="@array/lockscreen_targets_with_camera"
        android:targetDescriptions="@array/lockscreen_target_descriptions_with_camera"
        android:directionDescriptions="@array/lockscreen_direction_descriptions"
        android:handleDrawable="@drawable/ic_lockscreen_handle"
        android:waveDrawable="@drawable/ic_lockscreen_outerring"
        android:outerRadius="@dimen/multiwaveview_target_placement_radius"
        android:snapMargin="@dimen/multiwaveview_snap_margin"
        android:hitRadius="@dimen/multiwaveview_hit_radius"
        android:rightChevronDrawable="@drawable/ic_lockscreen_chevron_right"
        android:horizontalOffset="0dip"
        android:verticalOffset="60dip"
        android:feedbackCount="3"
        android:vibrationDuration="20"
        />

then I get this :

enter image description here

Now I want to show the missed call number on the center of the circle(in the picuture mouse position.),And I don’t know how to achieve.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T13:01:04+00:00Added an answer on June 15, 2026 at 1:01 pm

    you can make use of flag FLAG_SHOW_WHEN_LOCKED

    for more information on lock screen My android lock

    public static final int FLAG_SHOW_WHEN_LOCKED
    

    Lines from API level 5

    Window flag: special flag to let windows be shown when the screen is
    locked. This will let application windows take precedence over key
    guard or any other lock screens. Can be used with FLAG_KEEP_SCREEN_ON
    to turn screen on and display windows directly before showing the key
    guard window. Can be used with FLAG_DISMISS_KEYGUARD to automatically
    fully dismisss non-secure keyguards

    UPDATE1 for missed calls:

    All you need is to query the phone for any calls then extract missed one & Then just get the count of rows in the Cursor that is return by the query

    String[] projection = { CallLog.Calls.CACHED_NAME, CallLog.Calls.CACHED_NUMBER_LABEL, CallLog.Calls.TYPE };
           String where = CallLog.Calls.TYPE+"="+CallLog.Calls.MISSED_TYPE;          
           Cursor c = this.getContentResolver().query(CallLog.Calls.CONTENT_URI, selection,where, null, null);
           c.moveToFirst();    
           Log.d("CALL", ""+c.getCount()); //do some other operation
            if(c.getCount() == SOME_VALUE_TO_START_APP_ONE)
    

    In the where clause you set condition for selection of data. In your case you need everything which type equals CallLog.Calls.MISSED_TYPE.

    you can select the Name of the caller and his number, ofcourse you can specify more information to be queried like type of number like mobile, home, work.
    The expression is equivalent to SQL query, something like:

    SELECT CACHED_NAME, CACHED_NUMBER_LABEL, TYPE FROM CONTENT_URI WHERE TYPE=MISSED_TYPE
    

    UPDATE2: how to show the 2 in the picutre .?

    All you need to do is set the alarm string in the system settings, as follows:

    String message = "2";
    Settings.System.putString(context.getContentResolver(),
            Settings.System.NEXT_ALARM_FORMATTED, message);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an app that can make modify images. In some cases, this makes
I make an app that have to printing image. I need to print image
New to iOS, I have to make an app that will show photos and
I have an app that can show a stream of tweets from a twitter
I have a SDL app that compiles fine, and the images show up, but
I have an app that make USSD calls, but after all USSD calls i
I have to make a mobile app that calculates the real life size of
To make my doubt clear, I have this scenario: I have an app that
I have a very strange bug in a shipping iPad/iPhone app that I can't
I'm wondering about this: I have a simple facebook-connect app that will only show

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.