मैं फोनस्टेट लिस्टनर सेट अप करने की कोशिश करता हूं लेकिन मुझे "फोनकॉल लिस्टर को किसी प्रकार से हल नहीं किया जा सकता"।फोनस्टेट लिस्टनर
public class ButtonView extends FrameLayout {
PhoneCallListener phoneListener = new PhoneCallListener();
TelephonyManager telephonyManager = (TelephonyManager) this.getSystemService(Context.TELEPHONY_SERVICE);
telephonyManager.listen(phoneListener,PhoneStateListener.LISTEN_CALL_STATE);
}
अन्य उदाहरण में, मैं अपनी इस तरह से लिखा और यह
public class MainActivity extends Activity {
public void onCreate(Bundle savedInstanceState) {
// add PhoneStateListener
PhoneCallListener phoneListener = new PhoneCallListener();
TelephonyManager telephonyManager = (TelephonyManager) this
.getSystemService(Context.TELEPHONY_SERVICE);
telephonyManager.listen(phoneListener,PhoneStateListener.LISTEN_CALL_STATE);
}
मैं अपने कोड में क्या बदलना चाहिए बनाने के लिए काम कर काम कर रहा है पाया? मदद के लिए धन्यवाद
http://stackoverflow.com/questions/ 5345470/onclicklistener----------type-eclipse – Omarj