fragment conversion error in Android -
myfragment frag = fragmanager.findfragmentbyid(r.layout.testing_res);
testing_res
layout hosting activity
. it's spitting error @ me though
**required**: com.example.blahblah.blah.myfragment; **found** :android.app.fragment;
any suggestions why?
code fragment class
public class myfragment extends fragment { @override public void oncreate(bundle savedstate) { super.oncreate(savedstate); } @override public view oncreateview(layoutinflater i, viewgroup v, bundle state) { return i.inflate(r.layout.my_fragment, v, false); } }
try changing following import
import android.app.fragment
to
import android.support.v4.app.fragment
Comments
Post a Comment