程序问答   发布时间:2022-06-01  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了错误:没有找到合适的方法 add(String,Class<RouteRequestManagerFragment>)大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

如何解决错误:没有找到合适的方法 add(String,Class<RouterequestManagerFragment>)?

开发过程中遇到错误:没有找到合适的方法 add(String,Class<RouterequestManagerFragment>)的问题如何解决?下面主要结合日常开发的经验,给出你关于错误:没有找到合适的方法 add(String,Class<RouterequestManagerFragment>)的解决方法建议,希望对你解决错误:没有找到合适的方法 add(String,Class<RouterequestManagerFragment>)有所启发或帮助;

谢谢;我是 AndroID studio 和 java 的新手,但我尝试了尽可能多的我也可以使用 Google,但我不能,请任何人都可以帮助我解决这个错误。 请帮我!我在 AndroID studio 中构建 java 代码时收到此错误:找不到适用于 add(String,Class) 的方法。

package com.uit.huydaoduc.hIEu.chi.hhapp.Main.Driver.v2;

import androID.net.Uri;

import androIDx.vIEwpager.Widget.VIEwPager;
//import androID.support.v7.app.AppCompatActivity;
import androIDx.appcompat.app.AppCompatActivity;
import androID.os.bundle;

import com.uit.huydaoduc.hIEu.chi.hhapp.Main.Driver.v2.RouterequestManagerFragment;
import com.uit.huydaoduc.hIEu.chi.hhapp.R;
import com.ogaclejapan.smarttablayout.smartTabLayout;
import com.ogaclejapan.smarttablayout.utils.v4.FragmentPagerItemAdapter;
import com.ogaclejapan.smarttablayout.utils.v4.FragmentPagerItems;
//import androID.support.v13.app.FragmentPagerAdapter;

import cn.bingoogolapple.titlebar.bGAtitlebar;


public class DriverActivity extends AppCompatActivity
    implements RouterequestManagerFragment.onRouterequestManagerFragmentListener{

    BGAtitlebar titlebar;

    @OverrIDe
    protected voID onCreate(Bundle savedInstanceStatE) {
        super.onCreate(savedInstanceStatE);
        setContentVIEw(R.layout.activity_driver);

        FragmentPagerItemAdapter adapter = new FragmentPagerItemAdapter(
                getSupportFragmentManager(),FragmentPagerItems.with(this)
                .add("Your routes",RouterequestManagerFragment.class)
                .create());

        VIEwPager vIEwPager = (VIEwPager) findVIEwByID(R.ID.vIEwpager);
        vIEwPager.setAdapter(adapter);

        smartTabLayout vIEwPagerTab = (smartTabLayout) findVIEwByID(R.ID.vIEwpagertab);
        vIEwPagerTab.setVIEwPager(vIEwPager);

        Init();
        Event();
    }

    private voID Init() {
        titlebar = (BGAtitlebar) findVIEwByID(R.ID.titlebar);
    }

    private voID Event() {
        titlebar.setDelegate(new BGAtitlebar.Delegate() {
            @OverrIDe
            public voID onClickleftCtv() {

            }

            @OverrIDe
            public voID onClicktitleCtv() {

            }

            @OverrIDe
            public voID onClickRightCtv() {

            }

            @OverrIDe
            public voID onClickRightSecondaryCtv() {

            }
        });
    }

    @OverrIDe
    public voID onFragmenTinteraction(Uri uri) {

    }
}

我得到了这个代码,就像 grab 和 ubber

找车

。但是,当我构建它时出现了一些错误 请帮帮我!!! 我开始使用 java 和 androID 应用程序。

解决方法

该语句抛出错误:

FragmentPagerItemAdapter adapter = new FragmentPagerItemAdapter(
    getSupportFragmentManager(),FragmentPagerItems.with(this)
    .add("Your routes",RouterequestManagerFragment.class)
    .create());

add() 函数如下所示: 抽象乐趣添加(元素:E):布尔 要么 抽象乐趣添加(索引:整数,元素:E) doc

而且 "Your routes" 不是 Int 类型

,
    apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.uit.huydaoduc.hieu.chi.hhapp"
        minSdkVersion 21
        targetSdkVersion 26
        multiDexEnabled = true
        versionCode 3
        versionName "1.0.6"
        testinstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

    }
    lintOptions {
        checkReleaseBuilds false
        abortOnError false
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro'
        }
    }
    compiLeoptions {
        targetCompatibility 1.8
        sourceCompatibility 1.8
    }
}


dependencies {
    implementation fileTree(include: ['*.jar'],dir: 'libs')
    //noinspection GradleCompatible
    implementation 'com.android.support:appcompat-v7:26.+'
    implementation 'com.android.support.consTraint:consTraint-layout:1.0.2'
    implementation 'com.android.support:support-v4:28.0.0'
    implementation 'com.google.android.gms:play-services-plus:15.0.1'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'


    implementation 'com.github.d-max:spots-dialog:0.7@aar'
    implementation 'com.rengwuxian.materialedittext:library:2.1.4'
    implementation 'uk.co.chrisjenx:calligraphy:2.3.0'
    implementation 'com.android.support:cardview-v7:28.+'
    implementation 'com.google.android.gms:play-services-ads:15.0.1'
    implementation 'com.squareup.retrofit2:retrofit:2.3.0'
    implementation 'com.squareup.retrofit2:converter-scalars:2.3.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
    implementation 'de.hdodenhof:circleimageview:2.2.0'

    //Manager/place
    implementation 'com.google.maps.android:android-maps-utils:0.4.4'

    // login activity
    implementation "com.mikepenz:iconics-core:3.0.2@aar"
    implementation 'com.mikepenz:fontawesome-typeface:5.0.6.0@aar'

    // LOCATIOn
    implementation 'com.google.android.gms:play-services-LOCATIOn:15.0.1'
    implementation 'com.google.android.gms:play-services-maps:15.0.1'
    implementation 'com.google.android.gms:play-services-places:15.0.1'

    // for firebase
    implementation platform('com.google.firebase:firebase-bom:27.1.0')
    implementation 'com.google.firebase:firebase-analytics'
    implementation 'com.firebase:geofire-android:2.1.2'
    implementation 'com.google.firebase:firebase-core:12.0.1'
    implementation 'com.google.firebase:firebase-database:12.0.1'
    implementation 'com.google.firebase:firebase-messaging:12.0.1'
    implementation 'com.google.firebase:firebase-core:12.0.1'
    implementation 'com.google.firebase:firebase-auth:12.0.1'
    implementation 'com.google.firebase:firebase-messaging:12.0.1'

    // Facebook,Google login support is required
    implementation 'com.facebook.android:facebook-android-sdk:4.27.0'
    implementation 'com.google.android.gms:play-services-auth:15.0.1'

    // more...
    implementation 'com.android.support:design:28.1.0'       // support design
    implementation 'com.rengwuxian.materialedittext:library:2.1.4'     // material edittext
    implementation 'uk.co.chrisjenx:calligraphy:2.3.0'     // custom font for all view
    implementation 'com.android.support:cardview-v7:28.1.0'
    implementation 'com.android.support:appcompat-v7:28.1.0'
    implementation 'com.android.support:customtabs:28.0.0'
    implementation 'com.android.support:design:28.0.0'
    implementation 'com.android.support:support-v13:+'
    implementation 'androidx.legacy:legacy-support-v13:1.0.0'
    implementation 'androidx.viewpager:viewpager:1.0.0'

    // process bar
    implementation 'me.zhanghai.android.materialprogressbar:library:1.4.2'
    implementation 'com.lsjwzh:materialloadingprogressbar:0.5.8-RELEASE'

    // action bar
    implementation 'cn.bingoogolapple:bga-titlebar:1.0.8'

    // radius button
    implementation 'com.rilixtech:materialfancybuttons:1.8.7'

    // Date & Time picker
    implementation 'com.wdullaer:materialdatetiR_943_11845@epicker:3.6.0'

    // loading view
    implementation 'com.wang.avi:library:2.1.3'

    // recycler view
    implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.38'
    implementation 'com.android.support:cardview-v7:28.1.0'

    // alert dialog
    implementation 'com.afollestad.material-dialogs:core:0.9.6.0'

    // Top right menu
    implementation 'com.zaaach:toprightmenu:1.1.2'

    // Header For layout
    implementation 'com.scwang.smartrefresh:smartrefreshLayout:1.1.0-alpha-5'
    implementation 'com.scwang.smartrefresh:smartrefreshHeader:1.1.0-alpha-5'

    // Tab
    implementation 'com.ogaclejapan.smarttablayout:library:1.6.1@aar'
    implementation 'com.ogaclejapan.smarttablayout:utils-v4:1.6.1@aar'
    implementation 'lib.kingja.switchbutton:switchbutton:1.1.7'

    // Hieu
    implementation 'com.rilixtech:materialfancybuttons:1.8.7'
    implementation 'com.github.dimorinny:floaTing-text-button:0.0.4'

    //about
    implementation 'com.github.daniel-stoneuk:material-about-library:2.3.0'
    implementation 'com.github.jrvansuita:MaterialAbout:+'
    implementation 'com.android.support:support-Annotations:28.0.0'
    implementation 'com.intellij:Annotations:+@jar'

    //Hung
    implementation 'androidx.consTraintlayout:consTraintlayout:2.0.4'
    implementation 'androidx.consTraintlayout:consTraintlayout-compose:1.0.0-alpha05'
    implementation 'com.google.android.gms:play-services-maps:16.1.0'
    implementation 'com.android.support:support-fragment:28.0.+'
    implementation 'com.ogaclejapan.smarttablayout:library:1.7.0@aar'

}
// Add to the bottom of the file
apply plugin: 'com.google.gms.google-services'

这是我的 build.gradle

大佬总结

以上是大佬教程为你收集整理的错误:没有找到合适的方法 add(String,Class<RouteRequestManagerFragment>)全部内容,希望文章能够帮你解决错误:没有找到合适的方法 add(String,Class<RouteRequestManagerFragment>)所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: