Hi im developing a BLE App. After i scanned for devices and Display them into a ListFragment i want to get Services and Characteristics of them. If i implemented that in onListItemClick everything is fine i get the Services and the Characteristics. But now i want a new Activity started while i click on one Item.
@Override public void onListItemClick(ListView l, View v, int position, long id) { super.onListItemClick(l, v, position, id); rightPosition = position + 1; connectToDevice(); Intent intent = new Intent(getActivity(),ServiceCharacteristicAvtivity.class); startActivity(intent); } If i do like above my App crashes really looked for a solution but didnt get my failure. Maybe it is so easy that i dont see it. Can someone help me out?
The Log i get is
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.fkoffle.blescanner/com.example.fkoffle.blescanner.ServiceCharacteristicAvtivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity. at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3319) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3415) at android.app.ActivityThread.access$1100(ActivityThread.java:229) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1821) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:7331) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120) caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity. at android.support.v7.app.AppCompatDelegateImplV9.createSubDecor(AppCompatDelegateImplV9.java:356) at android.support.v7.app.AppCompatDelegateImplV9.ensureSubDecor(AppCompatDelegateImplV9.java:325) at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:286) at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139) The activity i want to start is just
public class ServiceCharacteristicAvtivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_service_characteristic_avtivity); } }