I'm getting an error in getFragmentManager() method, here is my code:
[HIGH]
public class WebViewActivity extends Activity{
private WebView _mWebView;
private ViewStub _mViewStub;
private Button _mButton;
private View _mInflated;
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.web_view);
_mViewStub=((ViewStub)findViewById(R.id.southPlachHolder));
_mInflated=_mViewStub.inflate();
Fragment _iFragment=new CustomFragment();
FragmentTransaction _iFragmentTransaction=getFragmentManager().beginTransaction();
_iFragmentTransaction.replace(R.id.fragmentPlachHolder, _iFragment);
_iFragmentTransaction.commit();
_mButton=(Button)findViewById(R.id.loginButton);
_mButton.setOnClickListener(new View.OnClickListener(){
public void onClick(View v){
}
});
[/HIGH]
And in CustomFragment class I also get an error (supress new api):
[HIGH]
import android.annotation.SuppressLint;
import android.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.os.Bundle;
public class CustomFragment extends Fragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){
return inflater.inflate(R.layout.subtree, container, false);
}
}
[/HIGH]
[HIGH]
public class WebViewActivity extends Activity{
private WebView _mWebView;
private ViewStub _mViewStub;
private Button _mButton;
private View _mInflated;
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.web_view);
_mViewStub=((ViewStub)findViewById(R.id.southPlachHolder));
_mInflated=_mViewStub.inflate();
Fragment _iFragment=new CustomFragment();
FragmentTransaction _iFragmentTransaction=getFragmentManager().beginTransaction();
_iFragmentTransaction.replace(R.id.fragmentPlachHolder, _iFragment);
_iFragmentTransaction.commit();
_mButton=(Button)findViewById(R.id.loginButton);
_mButton.setOnClickListener(new View.OnClickListener(){
public void onClick(View v){
}
});
[/HIGH]
And in CustomFragment class I also get an error (supress new api):
[HIGH]
import android.annotation.SuppressLint;
import android.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.os.Bundle;
public class CustomFragment extends Fragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){
return inflater.inflate(R.layout.subtree, container, false);
}
}
[/HIGH]