kilo的复数 met res复数形式

This page in:License: ShareDetails1961 - 201520152014201320122011201020092008200720062005200420032002200120001999199819971996199519941993199219911990198919881987198619851984198319821981198019791978197719761975197419731972197119701969196819671966196519641963196219612015201420132012201120102009200820072006200520042003200220012000199919981997199619951994199319921991199019891988198719861985198419831982198119801979197819771976197519741973197219711970196919681967196619651964196319621961All Countries and EconomiesCountry19612015Cannot Resolve method Android Studio - Stack Overflow
Join the Stack Overflow Community
Stack Overflow is a community of 7.1 million programmers, just like you, helping each other.
J it only takes a minute:
I am getting an error on this code using
android studio
Cannot resolve method 'add(int, android.trey.startingpoint.nl.SecondActivity.PlaceHolderFragment)'
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_second);
if (savedInstanceState == null) {
getFragmentManager().beginTransaction()
.add(R.id.container, new PlaceholderFragment()).commit();
public static class PlaceholderFragment extends Fragment {
public PlaceholderFragment() {
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_second, container, false);
return rootV
In seperate posts i found out that when you delete the if part, things should roll fine, except that it
throws another error.
Thanks for the help!
Edit:Imports:
import android.app.A
import android.support.v4.app.F
import android.os.B import android.view.LayoutI import
android.view.M import android.view.MenuI import
android.view.V import android.view.ViewG import
android.widget.T
import com.google.android.gms.maps.CameraUpdateF import
com.google.android.gms.maps.GoogleM import
com.google.android.gms.maps.MapF import
com.google.android.gms.maps.model.BitmapDescriptorF import
com.google.android.gms.maps.model.CameraP import
com.google.android.gms.maps.model.LatL import
com.google.android.gms.maps.model.MarkerO
PlaceholderFragment might be a support fragment.
Change getFragmentManager to getSupportFragmentManager() as below:
if (savedInstanceState == null) {
getSupportFragmentManager().beginTransaction()
.add(R.id.container, new PlaceholderFragment()).commit();
Your activity must also extend FragmentActivity.
If you don't intend on using support fragments then you can just change the import for the fragments.
Change import android.support.v4.app.F to import android.app.F
2,20822742
change getFragmentManager().beginTransaction()
.add(R.id.container, new PlaceholderFragment()).commit();
getSupportFragmentManager().beginTransaction()
.replace(R.id.container, new PlaceholderFragment()).commit();
Change import android.app.F to android.support.v4.app.F
import android.os.B
import android.support.v4.app.F
import android.support.v7.app.AppCompatA
import android.view.LayoutI
import android.view.V
import android.view.ViewG
public class MainActivity extends AppCompatActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
if (savedInstanceState == null) {
getSupportFragmentManager().beginTransaction()
.add(R.id.container, new PlaceholderFragment()).commit();
public static class PlaceholderFragment extends Fragment {
public PlaceholderFragment(){
public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
View rootView = inflater.inflate(R.layout.fragment_main, container, false);
return rootV
in your fragment file
import android.support.v4.app.F
rather than import android.app.F
Here is example:
In your activity file:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_set_travel_message);
TravelMessageFragment fragment = new TravelMessageFragment();
getSupportFragmentManager().beginTransaction().add(R.id.travelInit,fragment).commit();
than in your fragment file:
import android.support.v4.app.F
import android.os.B
import android.view.LayoutI
import android.view.V
import android.view.ViewG
public class TravelMessageFragment extends Fragment{
public View onCreateView(LayoutInflater inflater, ViewGroup group, Bundle savedInstanceState) {
view = inflater.inflate(R.layout.fragment_travel_message, group, false);
Cannot resolve method 'add(int, android.trey.startingpoint.nl.SecondActivity.PlaceHolderFragment)'
Change two things
First Thing :
you can create object of class "android.trey.startingpoint.nl.SecondActivity.PlaceHolderFragment" instead of putting class name
if(findViewById(R.id.fragment_container) != null) {
if(savedInstanceState != null) {
PlaceHolderFragment mFragment = new PlaceHolderFragment();
mFragment.setArguments(getIntent().getExtras());
getSupportFragmentManager().beginTransaction().add(R.id.fragment_container,th
irdFragment).commit();
Second Thing:
Go to class file PlaceHolderFragment and change import " android.support.v4.app.Fragment" from "android.support.app.Fragment"
Change import android.support.v4.app.F to import android.app.F
and also getSupportFragmentManager() to
getFragmentManager
if (savedInstanceState == null)
getFragmentManager().beginTransaction().add(R.id.container, new PlaceholderFragment()).commit();
it works for me
5,35521335
Your Answer
Sign up or
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Post as a guest
By posting your answer, you agree to the
Not the answer you're looking for?
Browse other questions tagged
rev .25812
Stack Overflow works best with JavaScript enabled

我要回帖

更多关于 复数的指数形式 的文章

 

随机推荐