0

I have two packages. The first one is for the Bluetooth socket of my phone, while the second one handles the other activities of my app.

What I wanted to do is call the DeviceListActivity from the .remote.btconnection (first) package and use it in all of my activities in my second package that needs it. I keep getting a force close everytime I tap on my inflater menu that calls that activity.

(I'm not quite sure if I declared the DeviceListActivity in my manifest correctly, too.)

Here is how I declared it (my class from first package) in my manifest:

              <activity 

              android:name="com.luugiathuy.apps.remote.btconnection.DeviceListActivity"
              android:label="@string/select_device"
              android:theme="@android:style/Theme.Dialog"
              android:configChanges="orientation|keyboardHidden" 
              android:screenOrientation="portrait" >

              </activity>

Here is my code in calling it in a class/activity in my second package:

public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
    case R.id.scan:
        // Launch the DeviceListActivity to see devices and do scan
        Intent serverIntent = new Intent(GetFrequencyActivity.this, DeviceListActivity.class);
        startActivityForResult(serverIntent, REQUEST_CONNECT_DEVICE);
        return true;

Would you see where I got it wrong? Thanks!

4

0 回答 0