Hi everybody,

I am new In android, stuck with a task to lunch a new screen
(Activity) while doing or reeving a GSM call.
For same I have done fallowing but that activity which I want to
launch is launched at background and that screen is visible only when
click on back key.

public void onCallStateChanged(int state,String incomingNumber){
                switch(state)
        {
           case TelephonyManager.CALL_STATE_IDLE:
                Log.d("DEBUG", "IDLE");
                break;
           case TelephonyManager.CALL_STATE_OFFHOOK:

// ACTIVITY TO LAUNCH

                   Receiver.mContext.startActivity(new
Intent(Receiver.mContext,FlashLight.class));

                break;
           case TelephonyManager.CALL_STATE_RINGING:
                   Log.i("DEBUG", "RINGING");
                   if(Tab1.CALL_BACK){
                           Tab1.CALL_BACK=false;
                   TelephonyManager tm = (TelephonyManager)
context.getSystemService(Context.TELEPHONY_SERVICE);
               if (tm.getCallState() !=
TelephonyManager.CALL_STATE_RINGING) {
                       return;
               }

               // Simulate a press of the headset button to pick up
the call
               Intent new_intent = new
Intent(Intent.ACTION_MEDIA_BUTTON);
               new_intent.putExtra(Intent.EXTRA_KEY_EVENT, new
KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_HEADSETHOOK));
               context.sendOrderedBroadcast(new_intent, null);

                   }
                   break;
        }


-----------------------------------------------------------------------

import org.sipdroid.sipua.ui.R;

import android.app.Activity;
import android.os.Bundle;
import android.os.Process;
public class FlashLight extends Activity {
    /** Called when the activity is first created. */
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        android.os.Process
                
.setThreadPriority(android.os.Process.THREAD_PRIORITY_URGENT_DISPLAY);
        Process.setThreadPriority(12);
//        Process.setThreadPriority(Process.myTid(), 12);
        setContentView(R.layout.flashlight);

    }
}


As you can see that I also set the priority by using
 
android.os.Process.setThreadPriority(android.os.Process.THREAD_PRIORITY_URGENT_DISPLAY);

but it is also not working .

Please tell me if there is any other way to replace inCall or outCall
screen with our custom screen.

Thanks,
Abhit Nigam

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to