0

The problem it solved, in this discussion, I gave the solution of the problem: Solution to the problem

I created a project with Android Studio 1.1. With support by the API 19 to 22

But now I'm having problems with compatibility libraries:

import android.support.v4.app.Fragment;
import android.app.Fragment;

I created a Navigation Drawer Activity as a base. I created following a fragment blank.

I simply had to call this new fragment in my Navigation Drawer, or rather in my ActivityMain in onNavigationDrawerItemSelected method, but I have a problem with the libraries.

In my ActivityMain, libraries are: android.support.v4.app.Fragment; while in the new Fragment Blank I created, the libraries are: import android.app.Fragment;

And of course when I try to interact with objects of type Fragment to maneuver the switch case, I have compatibility problems? between:

import android.app.Fragment;
import android.support.v4.app.Fragment;

What causes all this confusion?

I state that I have done nothing, if not simply create classes.

Where am I wrong?

Community
  • 1
  • 1
Nemesis
  • 41
  • 5
  • 1
    Use `android.support.v4.app.Fragment` if you are using `support-v4`, that is all. – Jared Burrows Apr 15 '15 at 00:08
  • @Jared Burrows Thanks for the reply .... I solved anyway. I deleted the fragment, and recreated. And now it does not give me more trouble. But the problem was another. SwtichCase it did not work, because the application crashed, when it is called the object of type fragment. I solved this way, the answer I wrote here: http://stackoverflow.com/questions/20638967/how-to-change-fragments-using-android-navigation-drawer/29623908#29623908 – Nemesis Apr 15 '15 at 08:02
  • The solution I found some in this post, where I gave my answer, the solution of the problem! : http://stackoverflow.com/questions/20638967/how-to-change-fragments-using-android-navigation-drawer/29623908#29623908 – Nemesis Apr 15 '15 at 08:03
  • 1
    Post your solution as an answer. – Jared Burrows Apr 15 '15 at 12:21

0 Answers0