android - Cannot work with SherlockFragment -


i have problem sherlockfragment. if change "extends sherlockfragment" "fragment", works perfectly. when working sherlock, work way.

this code fragment:

import com.actionbarsherlock.app.sherlockfragment; import android.os.bundle; import android.view.layoutinflater; import android.view.view; import android.view.viewgroup;   public class box extends sherlockfragment {      public box(){}      @override     public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) {          view rootview = inflater.inflate(r.layout.box, container, false);         return rootview;     } } 

in activitymain.java have this:

sherlockfragment fragment = null; 

it works fragment fragment = null;

and call it:

fragment= new box(); 

but problem .replace in code:

 fragmentmanager fragmentmanager = getfragmentmanager();  fragmentmanager.begintransaction().replace(r.id.content_frame, fragment).commit(); 

change getfragmentmanager getsupportfragmentmanager using sherlockfragment

fragmentmanager fragmentmanager = getsupportfragmentmanager();  fragmentmanager.begintransaction().replace(r.id.content_frame, fragment).commit(); 

Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -