package supa.mack.doppler;
import java.util.Set;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.bluetooth.*;
import android.widget.Toast;
public class doppler_test extends Activity {
TextView out;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
out = (TextView) findViewById(R.id.out);
// Getting the Bluetooth adapter
BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
out.append("\nAdapter: " + adapter);
// Check for Bluetooth support in the first place
// Emulator doesn't support Bluetooth and will return null
if(adapter==null) {
out.append("\nBluetooth NOT supported. Aborting.");
return;
}
// Starting the device discovery
out.append("\nStarting discovery...");
adapter.startDiscovery();
out.append("\nDone with discovery...");
// Listing paired devices
out.append("\nDevices Pared:");
Set<BluetoothDevice> devices = adapter.getBondedDevices();
for (BluetoothDevice device : devices) {
out.append("\nFound device: " + device);
}
Button searchButton=(Button) findViewById(R.id.search_button);
searchButton.setOnClickListener(new View.OnClickListener(){
public void onClick(View v) {
Intent intent=new Intent(
doppler_test.this,
search_result.class
);
startActivity(intent);
}
});
}
}
--------------------------- ----------- ...गतिविधि प्रबंधक: चेतावनी: गतिविधि शुरू नहीं हुई है, इसका वर्तमान कार्य सामने
यहाँ कोड जहां समस्या है ....
जब मैं एंड्रॉयड एमुलेटर चलाने मुझे एक त्रुटि यह वास्तव में कहना है कि यह नहीं देता है
"[2010-08-25 09:12:42 - doppler_test] ActivityManager: Warning: Activity not started, its current task has been brought to the front"
मुझे लगता है कि इसका मतलब यह है कि ब्लूटूथ फ़ंक्शन और बटन का इरादा केवल ऑपरेशन है एन एक पदानुक्रम प्रणाली। मेरा मतलब यह है कि अगर मैं ब्लूटूथ सामग्री के ऊपर बटन ऑपरेटर को स्थानांतरित करना चाहता था तो बटन काम करेगा, लेकिन वर्तमान में जब ऐप चलाया जाता है तो ब्लूटूथ काम करता है लेकिन जब मैं खोज बटन दबाता हूं तो कुछ भी नहीं होता है।
और क्या मददगार हो सकता है बटन के अनुरूप अपने XML कोड इसलिए यहाँ यह है ......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.co…
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center_horizontal"
android:background="@color/purple_flurp"…
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello"/>
<Button
android:id="@+id/search_button"
android:layout_height="wrap_content"
android:text="@string/search"
android:layout_width="fill_parent"/>
<TextView
android:text="@+id/TextView01"
android:id="@+id/out"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</TextView>
</LinearLayout>
----------------- --------------------- ...
कोई विचार? कुछ भी अच्छा होगा! धन्यवाद
फल्मरी में जोड़ना, @ डेविड सिर्फ एक परियोजना करें> प्रोजेक्ट को पुन: संकलित करने के लिए साफ करें – 100rabh
मुझे कुछ स्ट्रिंग्स.एक्सएमएल फ़ाइल एक चींटी लक्ष्य से बना है, मुझे लगता है कि यह प्रोजेक्ट (एफ 5) और फिर अपने उत्तर के लिए डिवाइस/एमुलेटर :) thx में ऐप शुरू करें –