久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<legend id='mJRCO'><style id='mJRCO'><dir id='mJRCO'><q id='mJRCO'></q></dir></style></legend>
  • <small id='mJRCO'></small><noframes id='mJRCO'>

      <bdo id='mJRCO'></bdo><ul id='mJRCO'></ul>

  • <i id='mJRCO'><tr id='mJRCO'><dt id='mJRCO'><q id='mJRCO'><span id='mJRCO'><b id='mJRCO'><form id='mJRCO'><ins id='mJRCO'></ins><ul id='mJRCO'></ul><sub id='mJRCO'></sub></form><legend id='mJRCO'></legend><bdo id='mJRCO'><pre id='mJRCO'><center id='mJRCO'></center></pre></bdo></b><th id='mJRCO'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='mJRCO'><tfoot id='mJRCO'></tfoot><dl id='mJRCO'><fieldset id='mJRCO'></fieldset></dl></div>

      <tfoot id='mJRCO'></tfoot>

        無法解析方法'show(android.support.v4.app.FragmentMa

        Cannot resolve method #39;show(android.support.v4.app.FragmentManager, java.lang.String)(無法解析方法show(android.support.v4.app.FragmentManager, java.lang.String))
      1. <i id='svu9C'><tr id='svu9C'><dt id='svu9C'><q id='svu9C'><span id='svu9C'><b id='svu9C'><form id='svu9C'><ins id='svu9C'></ins><ul id='svu9C'></ul><sub id='svu9C'></sub></form><legend id='svu9C'></legend><bdo id='svu9C'><pre id='svu9C'><center id='svu9C'></center></pre></bdo></b><th id='svu9C'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='svu9C'><tfoot id='svu9C'></tfoot><dl id='svu9C'><fieldset id='svu9C'></fieldset></dl></div>
          <tbody id='svu9C'></tbody>

        <small id='svu9C'></small><noframes id='svu9C'>

            • <tfoot id='svu9C'></tfoot>

                • <bdo id='svu9C'></bdo><ul id='svu9C'></ul>
                  <legend id='svu9C'><style id='svu9C'><dir id='svu9C'><q id='svu9C'></q></dir></style></legend>
                • 本文介紹了無法解析方法'show(android.support.v4.app.FragmentManager, java.lang.String)的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  由于某種原因,當我嘗試顯示對話框時,我從 dialog.show(fm, DIALOG_DATE); 收到錯誤消息.說無法解析方法'show(android.support.v4.app.FragmentManager, java.lang.String)'

                  For some reason when I try to show a Dialog I get an error from dialog.show(fm, DIALOG_DATE); saying Cannot resolve method 'show(android.support.v4.app.FragmentManager, java.lang.String)'

                  為什么不能解析方法?

                  mDateButton.setOnClickListener(new View.OnClickListener() {
                          public void onClick(View v) {
                              FragmentManager fm = getActivity().getSupportFragmentManager();
                              DatePickerFragment dialog = new DatePickerFragment();
                              dialog.show(fm, DIALOG_DATE);
                          }
                      });
                  

                  這是我班的其余部分:

                  package com.bignerdranch.android.criminalintent;
                  import android.os.Bundle;
                  import android.support.v4.app.Fragment;
                  import android.support.v4.app.FragmentManager;
                  import android.text.Editable; 
                  import android.text.TextWatcher;
                  import android.view.LayoutInflater;
                  import android.view.View;
                  import android.view.ViewGroup;
                  import android.widget.CheckBox;
                  import android.widget.Button;
                  import android.widget.CompoundButton;
                  import android.widget.CompoundButton.OnCheckedChangeListener;
                  import android.widget.EditText;
                  
                  import java.util.UUID;
                  
                  
                  public class CrimeFragment extends Fragment {
                  //key for the extra
                  public static final String EXTRA_CRIME_ID = "com.bignerdranch.android.criminalintent.crime_id";
                  
                  private static final String DIALOG_DATE = "date";
                  
                  //holds crime
                  private Crime mCrime;
                  
                  //widgets
                  private EditText mTitleField;
                  private Button mDateButton;
                  private CheckBox mSolvedCheckBox;
                  
                  //at start of build
                  @Override
                  public void onCreate(Bundle savedInstanceState) {
                      super.onCreate(savedInstanceState);
                      //get crime from crime class
                  
                      /*Intents
                      *There are two ways a fragment can access data in its activity's intent:
                      * an easy direct shortcut
                      * or a complex flexible implementation
                      * First try out the shortcut
                      * in the shortcut, CrimeFragment will access CrimeActivity's intent directly
                       */
                  
                      //retrieve the extra from CrimeActivity's intent and use it to fetch the Crime
                      //UUID crimeId = (UUID)getActivity().getIntent().getSerializableExtra   (EXTRA_CRIME_ID); //shortcut removed in chapter 10 and "should feel warm and fuzzy inside for maintaining CrimeFragments Independence"
                      //
                      UUID crimeId = (UUID)getArguments().getSerializable(EXTRA_CRIME_ID);
                      //CrimeLab.get() requires a context object, so CrimeFragment passes the CrimeActivity
                      mCrime = CrimeLab.get(getActivity()).getCrime(crimeId);
                  
                  }
                  
                  //Create the view and inflate the layout
                  @Override
                  public View onCreateView(LayoutInflater inflater, ViewGroup container,
                                           Bundle savedInstanceState) {
                      // Inflate the layout for crime Fragment
                      //pass false because view will be added in the activitys code
                      View v = inflater.inflate(R.layout.fragment_crime, container, false);
                  
                      //gets crime_title from fragment_crime.xml
                      mTitleField = (EditText)v.findViewById(R.id.crime_title);
                      mTitleField.setText(mCrime.getTitle());
                      mTitleField.addTextChangedListener(new TextWatcher() {
                          @Override
                          public void beforeTextChanged(CharSequence s, int start, int count, int after) {
                              //not used
                          }
                  
                          @Override
                          public void onTextChanged(CharSequence s, int start, int before, int count) {
                                mCrime.setTitle(s.toString());
                          }
                  
                          @Override
                          public void afterTextChanged(Editable s) {
                              //also not used
                          }
                      });
                  
                  
                      //find date button from fragment_crime
                      mDateButton = (Button)v.findViewById(R.id.crime_date);
                      //set mDateButton text to current date and time
                      mDateButton.setText(mCrime.getDate().toString());
                      //disable button for now...enabled in chapter 12
                     // mDateButton.setEnabled(false);
                  
                  
                      mDateButton.setOnClickListener(new View.OnClickListener() {
                          public void onClick(View v) {
                              FragmentManager fm = getActivity().getSupportFragmentManager();
                              DatePickerFragment dialog = new DatePickerFragment();
                              dialog.show(fm, DIALOG_DATE);
                          }
                      });
                  
                  
                  
                  
                      //find solved checkbox from fragment_crime
                      mSolvedCheckBox = (CheckBox)v.findViewById(R.id.crime_solved);
                      mSolvedCheckBox.setChecked(mCrime.isSolved());
                      //user clicks solved check box
                      mSolvedCheckBox.setOnCheckedChangeListener(new OnCheckedChangeListener() {
                          public void onCheckedChanged(CompoundButton buttonView, boolean isChecked){
                              //set the crime's solved property
                              mCrime.setSolved(isChecked);
                          }
                      });
                      //returns the view
                      return v;
                  }
                  
                  /*The downside to direct retrieval
                  *can not encapsulate fragment
                  * CrimeFragment is no longer a reusable building block because it expects that it will always be hosted by an activity whose intent defines extra named "EXTRA_CRIME_ID"
                  * CrimeFragment cannot be used with just any activity
                  *
                   */
                  
                  /*Fragment Arguments
                  *A better solution is to stash the mCrimeId someplace that belongs to CrimeFragment rather than keeping it in CrimeActivity's personal space
                  * this someplace can be an arguments bundle
                  * Every fragment instance can have a Bundle object attached to it
                  * bundle contains key value pairs that work just like the intent extras of an activity
                  * Pg. 195
                   */
                  
                  /*attaching arguments to a fragment
                  *Attaching args to frags must be done after the frag is created but before it is added to the activity
                  * To hit this window use a static class called newInstance()
                  * This method creates the fragment instance and bundles up and sets its arguments
                   */
                  //for attaching arguments to a fragment
                  public static CrimeFragment newInstance(UUID crimeId){
                      Bundle args = new Bundle();
                      args.putSerializable(EXTRA_CRIME_ID, crimeId);
                  
                      CrimeFragment fragment = new CrimeFragment();
                      fragment.setArguments(args);
                  
                      //pass UUID from extra
                      return fragment;
                  }
                  

                  }

                  推薦答案

                  要解決這個問題,如果你使用的是 android.app.DialogFragment,那么使用 getFragmentManager():

                  To solve this, if you are using android.app.DialogFragment, then use getFragmentManager():

                  mDateButton.setOnClickListener(new View.OnClickListener() {
                          public void onClick(View v) {
                              FragmentManager fm = getActivity().getFragmentManager();
                              DatePickerFragment dialog = new DatePickerFragment();
                              dialog.show(fm, DIALOG_DATE);
                          }
                      });
                  

                  使用 getSupportFragmentManager(),必須擴展自:android.support.v4.app.DialogFragment.

                  檢查您的導入:

                  import android.support.v4.app.DialogFragment;
                  

                  這篇關于無法解析方法'show(android.support.v4.app.FragmentManager, java.lang.String)的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權益,請聯(lián)系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  How can I detect integer overflow on 32 bits int?(如何檢測 32 位 int 上的整數(shù)溢出?)
                  Local variables before return statements, does it matter?(return 語句之前的局部變量,這有關系嗎?)
                  How to convert Integer to int?(如何將整數(shù)轉(zhuǎn)換為整數(shù)?)
                  How do I create an int array with randomly shuffled numbers in a given range(如何在給定范圍內(nèi)創(chuàng)建一個隨機打亂數(shù)字的 int 數(shù)組)
                  Inconsistent behavior on java#39;s ==(java的行為不一致==)
                  Why is Java able to store 0xff000000 as an int?(為什么 Java 能夠?qū)?0xff000000 存儲為 int?)
                • <tfoot id='GfPuo'></tfoot>

                  • <legend id='GfPuo'><style id='GfPuo'><dir id='GfPuo'><q id='GfPuo'></q></dir></style></legend>

                      <tbody id='GfPuo'></tbody>

                      <small id='GfPuo'></small><noframes id='GfPuo'>

                          <bdo id='GfPuo'></bdo><ul id='GfPuo'></ul>
                        • <i id='GfPuo'><tr id='GfPuo'><dt id='GfPuo'><q id='GfPuo'><span id='GfPuo'><b id='GfPuo'><form id='GfPuo'><ins id='GfPuo'></ins><ul id='GfPuo'></ul><sub id='GfPuo'></sub></form><legend id='GfPuo'></legend><bdo id='GfPuo'><pre id='GfPuo'><center id='GfPuo'></center></pre></bdo></b><th id='GfPuo'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='GfPuo'><tfoot id='GfPuo'></tfoot><dl id='GfPuo'><fieldset id='GfPuo'></fieldset></dl></div>
                            主站蜘蛛池模板: 7777在线视频免费播放 | 亚洲一区二区精品视频在线观看 | 日韩在线资源 | 99久久精品国产一区二区三区 | 日本精品一区二区 | 亚洲二区视频 | 免费观看一级毛片视频 | 日韩视频在线播放 | 一区精品视频 | 国产亚洲一级 | av中文字幕在线播放 | 中文字幕一区在线 | 日韩欧美在线一区二区 | 国产日产精品一区二区三区四区 | 欧美一区免费 | 麻豆va| 精品国产一区二区三区性色av | 久久九精品 | 久久精品中文字幕 | 国产一区亚洲 | 日韩在线一区二区三区 | 色爽女| 国产女人与拘做受免费视频 | 亚洲视频一区在线播放 | 亚洲在线观看视频 | 91伊人网 | 成人福利在线 | 欧美乱码精品一区二区三区 | 精品国产色 | 欧美a级网站 | 欧美簧片| 亚洲精品一区二区三区 | 成人午夜网站 | 精品久久香蕉国产线看观看亚洲 | 91精品国产91久久久久久吃药 | 亚洲精久久 | 涩涩视频在线观看 | 一本一道久久a久久精品蜜桃 | pacopacomama在线| 国产精品二区三区 | 国产欧美视频一区二区 |