Android 기기에서 블루투스를 사용하도록 설정하려고합니다. Android 설명서를 읽었으며 그 과정이 무엇인지 잘 알고 있습니다. 그러나 실제로 매니 페스트 파일을 사용하여 액티비티를 실제로 실행하는 데 어려움을 겪고 있습니다. 이티타늄 내 Android 활동 설정
나는 두 개의 클래스와 안드로이드 모듈을 개발했습니다 ... 지금까지 한 일이다
- 는 블루투스 모듈 // KrollModule를 확장
- 는 BluetoothSetup // 활동 를 확장 BluetoothSetup에서
는 onCreate
방법과 같이 보인다 :
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
connectBluetooth();
}
또한 BluetoothSetup의 connectBluetooth() 메소드 보이는 같은 :
protected void connectBluetooth(){
// if statements to check if bluetooth is enabled/avail removed
Intent intentBluetooth = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
startActivityForResult(intentBluetooth, 0);
}
}
마지막으로, 모듈의 timodule.xml에 내가 추가 한 :
<activity android:label="@string/app_name" android:name="com.eyesore.bluetooth2.BluetoothSetup">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
모듈은 잘 컴파일하지만 실제로는하지 않습니다 뭐든지해라. 나는 근본적인 단계를 놓쳤다는 것을 두려워하지만, 나는 그것이 무엇인지 모를 뿐이다. 모든 조언을 크게 주시면 감사하겠습니다!
답변을 가장 좋은 답으로 표시해야합니다. –