0

In my project i tried to implement camera action in onReceive method. While clicking on camera icon can we print log . i tried it in broadcast receiver. but i cant able to get the result.i attached my piece of code here.

    public void onReceive(Context context, Intent intent) {

        if (intent.getAction().equals(Intent.ACTION_CAMERA_BUTTON)) {

            Log.e("cam0","cam");
        //Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
        //context.startService(cameraIntent);
   // startActivity(cameraIntent, CAMERA_PIC_REQUEST);
        }
    }

is it possible to print log for that. Im cracking my head still i cant find the result. Looking for help in this situation. Thank you in advance.

4

1 に答える 1

1

Logcat のフィルターを作成して、特定の TAG を持つすべてのログをグループ化して、すばやく簡単に表示できるようにすることができます。Logcat ビューを開くと、左側に新しいフィルターを追加するためのボタン (緑色のプラス記号) があります。

そして、ログタグとして使用されるクラスで定数を宣言するというその慣例、たとえばprivate static final string TAG = TAG_camActivity.

ログが表示されない場合、その if ステートメントはおそらく true と評価されていません。

于 2012-05-26T11:26:00.007 に答える