non static method can not be refferenced ... 이런식으로 에러가 나거든요
코드는
package com.example.unityproject;
import android.app.Activity;
import android.media.AudioManager;
import android.media.AudioDeviceInfo;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.BroadcastReceiver;
public class PluginClass extends Activity
{
private static IntentFilter mIntentFilter = new IntentFilter(Intent.ACTION_HEADSET_PLUG);
private static BroadcastReceiver mBroadcastReceiver = null;
private static boolean isearphone = false;
public static boolean isHeadphonesPlugged(Context c)
{
mBroadcastReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent)
{
AudioManager audio = (AudioManager) getSystemService(자바 파일.this.AUDIO_SERVICE);
int systemVolume = audio.getStreamVolume(AudioManager.STREAM_SYSTEM);
isearphone = (Intent.getIntExtra("state", 0) > 0) ? true : false;
}
};
return isearphone;
}
}
이렇게 되어있는데요.. 뭐가문제인지 잘모르겠어요..