O
Organized
Neues Mitglied
- 0
Moin
Ich habe ein ganz kleines Programm geschrieben (zum Üben):
Eclipse gibt keinen Fehler aus, aber auf meinem HTC Wildfire sagt er, dass com.android.btaddress unerwartet beendet werden musste. Macht da die Bezeichnung "com.ANDROID.btaddress" was aus oder ist die eh' egal?
Gruß,
Andy
Ich habe ein ganz kleines Programm geschrieben (zum Üben):
Code:
package com.android.btaddress;
import android.app.Activity;
import android.bluetooth.*;
import android.content.Intent;
import android.widget.TextView;
import android.os.Bundle;
public class btaddress extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TextView txt = new TextView(this);
BluetoothAdapter bt = BluetoothAdapter.getDefaultAdapter();
if (bt == null)
txt.setText("Kein BT verfuegbar");
if (!bt.isEnabled()) {
Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
startActivityForResult(enableBtIntent, RESULT_OK);
}
if(bt.isEnabled()) {
txt.setText("BT-Addr: \n" + bt.getAddress());
}
else {
txt.setText("Fehler!");
}
setContentView(txt);
}
}
Eclipse gibt keinen Fehler aus, aber auf meinem HTC Wildfire sagt er, dass com.android.btaddress unerwartet beendet werden musste. Macht da die Bezeichnung "com.ANDROID.btaddress" was aus oder ist die eh' egal?
Gruß,
Andy