使用Android源$ C ​​$ C [英] Using Android source code

查看:97
本文介绍了使用Android源$ C ​​$ C的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发一个应用程序,我取得了CallCard.java类手机应用程序的一些变化。你可以在这里找到这个类<$c$c><http://www.netmite.com/android/mydroid/packages/apps/Phone/src/com/android/phone/CallCard.java>.另外,在上述类有一些情况。即BUSY,NUMBER_UNREACHABLE和POWER_OFF等。POWER_OFF的情况下,我叫下面的类的方法。

I am developing one application for that I made some changes in CallCard.java class of Phone application. You can find this class here <http://www.netmite.com/android/mydroid/packages/apps/Phone/src/com/android/phone/CallCard.java>. In the above class there are some cases. i.e BUSY, NUMBER_UNREACHABLE and POWER_OFF etc. In the case of POWER_OFF I called a method of a below class.

public class MyClass extends Activity{ 



    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        System.out.println("**inside myclass");

    }

    public  void  powerOff(Context c){
        System.out.println("**inside powerOff");
        Intent call = new Intent(Intent.ACTION_DIAL,Uri.parse("tel:+5555")); 
        startActivity(call);
    }

}

这是我自己的类,然后添加到源代码目录Phone应用程序。在code是这样的:

This is my own class and added into source directory Phone application. The code is like this:

case POWER_OFF:
   resID = R.string.callFailed_powerOff;
   MyClass myClass = new MyClass();
   if(myClass != null){
       System.out.println("**not null");
        myClass.powerOff(getContext);
    }
   break;

之所以要做到这一点,我想打电话给同一个人的其他号码时先拨打的号码switched_off(currentl硬codeD编号)。我觉得这是只有一个办法了这一点。!! Finaly我开始建立code,但得到了一些错误。即无法找到符号

The reason to do this is, I want to Call other number of same person when first-dialed number is switched_off(currentl hard-coded number). I think this is only one way to this.!! Finaly I started build the code but got some error. i.e 'Cannot find symbol'

Symbol: variable getContext
Location: com.android.phone.
    myClass.powerOff(getContext);
                     ^

是我的方法正确吗?为什么这个错误。 plz帮助我

Is my way correct? and why this error. plz help me

推荐答案

不是的getContext方法? IMO使用的getContext()应该工作。
或者,根据这个,你可能想调整它多一点。

Isn't getContext a method? IMO using getContext() should work. Or, according to this, you might want tweak it a bit more.

这篇关于使用Android源$ C ​​$ C的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆