首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
社区首页 >问答首页 >重新发布:在类上找不到mblogBegginer的设置器/字段

重新发布:在类上找不到mblogBegginer的设置器/字段
EN

Stack Overflow用户
提问于 2018-08-25 21:34:51
回答 1查看 299关注 0票数 0

在类com.mahmoudradwan.e_news.Blog上找不到mblogBegginer的setter/field我已经在博客类中定义了setter,但是它给了我错误的setter和setter,由android studio生成的setter和setter尝试了论坛中找到的所有答案,有人能帮我吗??这是我的第二篇帖子,因为我没有得到任何有用的回复

我的博客对象类

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
package com.mahmoudradwan.e_news;

/**
 * Created by Mahmoud Radwan on 16/08/2018.
 */

public class Blog {
    private static String mtitle;
    private static String mblogBegginer;
    private String mblogIntermediate;
    private String mblogAdvanced;
    private static String mImageurl;
    private String mAudioBegginersurl;
    private String mAudioIntermediateurl;
    private String mAudioAdvancedurl;

    public Blog() {
    }

    public static String getMtitle() {
        return mtitle;
    }

    public static void setMtitle(String mtitle) {
        Blog.mtitle = mtitle;
    }

    public static String getMblogBegginer() {
        return mblogBegginer;
    }

    public static void setMblogBegginer(String mblogBegginer) {
        Blog.mblogBegginer = mblogBegginer;
    }

    public String getMblogIntermediate() {
        return mblogIntermediate;
    }

    public void setMblogIntermediate(String mblogIntermediate) {
        this.mblogIntermediate = mblogIntermediate;
    }

    public String getMblogAdvanced() {
        return mblogAdvanced;
    }

    public void setMblogAdvanced(String mblogAdvanced) {
        this.mblogAdvanced = mblogAdvanced;
    }

    public static String getmImageurl() {
        return mImageurl;
    }

    public static void setmImageurl(String mImageurl) {
        Blog.mImageurl = mImageurl;
    }

    public String getmAudioBegginersurl() {
        return mAudioBegginersurl;
    }

    public void setmAudioBegginersurl(String mAudioBegginersurl) {
        this.mAudioBegginersurl = mAudioBegginersurl;
    }

    public String getmAudioIntermediateurl() {
        return mAudioIntermediateurl;
    }

    public void setmAudioIntermediateurl(String mAudioIntermediateurl) {
        this.mAudioIntermediateurl = mAudioIntermediateurl;
    }

    public String getmAudioAdvancedurl() {
        return mAudioAdvancedurl;
    }

    public void setmAudioAdvancedurl(String mAudioAdvancedurl) {
        this.mAudioAdvancedurl = mAudioAdvancedurl;
    }

    Blog(String mtitle, String mblogBegginer, String mblogIntermediate, String mblogAdvanced,
         String mImageurl, String mAudioBegginersurl, String mAudioIntermediateurl, String mAudioAdvancedurl) {
        this.mtitle = mtitle;
        this.mblogBegginer = mblogBegginer;
        this.mblogIntermediate = mblogIntermediate;
        this.mblogAdvanced = mblogAdvanced;
        this.mImageurl = mImageurl;
        this.mAudioBegginersurl = mAudioBegginersurl;
        this.mAudioIntermediateurl = mAudioIntermediateurl;
        this.mAudioAdvancedurl = mAudioAdvancedurl;
    }


}

文章探索类

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
package com.mahmoudradwan.e_news;

import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.widget.ListView;

import com.google.firebase.database.ChildEventListener;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ValueEventListener;

import java.util.ArrayList;
import java.util.List;

public class ArticlesExplore extends AppCompatActivity {
    FirebaseDatabase firebaseDatabase ;
    DatabaseReference blogReference ;
    ValueEventListener valueEventListener ;
    ListView listView ;
    RecyclerViewAdapter adapter ;
    List<Blog> articles = new ArrayList<>();
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_articles_explore);
        adapter = new RecyclerViewAdapter(this, R.layout.article_row, articles);
        listView = (ListView) findViewById(R.id.listView);
        listView.setAdapter(adapter);
        firebaseDatabase = FirebaseDatabase.getInstance();
        blogReference = firebaseDatabase.getReference().child("Article");
        blogReference.addChildEventListener(new ChildEventListener() {
            @Override
            public void onChildAdded(@NonNull DataSnapshot dataSnapshot, @Nullable String s) {
                    Blog blog = dataSnapshot.getValue(Blog.class);
                    adapter.add(blog);


                }


            @Override
            public void onChildChanged(@NonNull DataSnapshot dataSnapshot, @Nullable String s) {

            }

            @Override
            public void onChildRemoved(@NonNull DataSnapshot dataSnapshot) {

            }

            @Override
            public void onChildMoved(@NonNull DataSnapshot dataSnapshot, @Nullable String s) {

            }

            @Override
            public void onCancelled(@NonNull DatabaseError databaseError) {

            }

        });

    }
}

日志

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
08-20 15:08:06.597 5140-5140/? W/zygote: Unexpected CPU variant for X86 using defaults: x86
08-20 15:08:07.483 5140-5140/com.mahmoudradwan.e_news V/FA: Registered activity lifecycle callback
08-20 15:08:07.519 5140-5140/com.mahmoudradwan.e_news D/FirebaseApp: com.google.firebase.crash.FirebaseCrash is not linked. Skipping initialization.
08-20 15:08:07.520 5140-5140/com.mahmoudradwan.e_news I/FirebaseInitProvider: FirebaseApp initialization successful
08-20 15:08:07.521 5140-5140/com.mahmoudradwan.e_news I/InstantRun: starting instant run server: is main process
08-20 15:08:07.598 5140-5162/com.mahmoudradwan.e_news V/FA: Collection enabled
08-20 15:08:07.598 5140-5162/com.mahmoudradwan.e_news V/FA: App package, google app id: com.mahmoudradwan.e_news, 1:765020936650:android:fd8001655cf26b78
08-20 15:08:07.599 5140-5162/com.mahmoudradwan.e_news I/FA: App measurement is starting up, version: 12780
08-20 15:08:07.599 5140-5162/com.mahmoudradwan.e_news I/FA: To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
08-20 15:08:07.600 5140-5162/com.mahmoudradwan.e_news I/FA: To enable faster debug mode event logging run:
                                                              adb shell setprop debug.firebase.analytics.app com.mahmoudradwan.e_news
08-20 15:08:07.600 5140-5162/com.mahmoudradwan.e_news D/FA: Debug-level message logging enabled
08-20 15:08:07.686 5140-5162/com.mahmoudradwan.e_news I/zygote: IncrementDisableThreadFlip blocked for 5.170ms
08-20 15:08:07.701 5140-5140/com.mahmoudradwan.e_news V/FA: onActivityCreated
08-20 15:08:07.766 5140-5162/com.mahmoudradwan.e_news V/FA: Connecting to remote service
08-20 15:08:07.841 5140-5162/com.mahmoudradwan.e_news V/FA: Connection attempt already in progress
08-20 15:08:08.075 5140-5162/com.mahmoudradwan.e_news I/FA: Tag Manager is not found and thus will not be used
08-20 15:08:08.088 5140-5162/com.mahmoudradwan.e_news D/FA: Logging event (FE): screen_view(_vs), Bundle[{firebase_event_origin(_o)=auto, firebase_screen_class(_sc)=MainActivity, firebase_screen_id(_si)=3366437205721944027}]
08-20 15:08:08.095 5140-5167/com.mahmoudradwan.e_news D/OpenGLRenderer: HWUI GL Pipeline
08-20 15:08:08.158 5140-5162/com.mahmoudradwan.e_news V/FA: Connection attempt already in progress
08-20 15:08:08.158 5140-5162/com.mahmoudradwan.e_news V/FA: Connection attempt already in progress
08-20 15:08:08.163 5140-5162/com.mahmoudradwan.e_news V/FA: Activity resumed, time: 5862461
08-20 15:08:08.226 5140-5167/com.mahmoudradwan.e_news I/zygote: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 0
08-20 15:08:08.227 5140-5167/com.mahmoudradwan.e_news I/OpenGLRenderer: Initialized EGL, version 1.4
08-20 15:08:08.227 5140-5167/com.mahmoudradwan.e_news D/OpenGLRenderer: Swap behavior 1
08-20 15:08:08.230 5140-5167/com.mahmoudradwan.e_news W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
08-20 15:08:08.230 5140-5167/com.mahmoudradwan.e_news D/OpenGLRenderer: Swap behavior 0
08-20 15:08:08.250 5140-5167/com.mahmoudradwan.e_news D/EGL_emulation: eglCreateContext: 0xf19aff60: maj 2 min 0 rcv 2
08-20 15:08:08.284 5140-5167/com.mahmoudradwan.e_news D/EGL_emulation: eglMakeCurrent: 0xf19aff60: ver 2 0 (tinfo 0xf199b8a0)
08-20 15:08:08.445 5140-5167/com.mahmoudradwan.e_news D/EGL_emulation: eglMakeCurrent: 0xf19aff60: ver 2 0 (tinfo 0xf199b8a0)
08-20 15:08:08.640 5140-5162/com.mahmoudradwan.e_news D/FA: Connected to remote service
08-20 15:08:08.643 5140-5162/com.mahmoudradwan.e_news V/FA: Processing queued up service tasks: 4
08-20 15:08:14.009 5140-5162/com.mahmoudradwan.e_news V/FA: Inactivity, disconnecting from the service
08-20 15:08:27.008 5140-5162/com.mahmoudradwan.e_news V/FA: Recording user engagement, ms: 18944
08-20 15:08:27.011 5140-5162/com.mahmoudradwan.e_news V/FA: Connecting to remote service
08-20 15:08:27.019 5140-5162/com.mahmoudradwan.e_news V/FA: Activity paused, time: 5881404
08-20 15:08:27.027 5140-5162/com.mahmoudradwan.e_news D/FA: Logging event (FE): user_engagement(_e), Bundle[{firebase_event_origin(_o)=auto, engagement_time_msec(_et)=18944, firebase_screen_class(_sc)=MainActivity, firebase_screen_id(_si)=3366437205721944027}]
08-20 15:08:27.048 5140-5140/com.mahmoudradwan.e_news V/FA: onActivityCreated
08-20 15:08:27.175 5140-5162/com.mahmoudradwan.e_news V/FA: Connection attempt already in progress
08-20 15:08:27.187 5140-5162/com.mahmoudradwan.e_news D/FA: Logging event (FE): screen_view(_vs), Bundle[{firebase_event_origin(_o)=auto, firebase_previous_class(_pc)=MainActivity, firebase_previous_id(_pi)=3366437205721944027, firebase_screen_class(_sc)=ArticlesExplore, firebase_screen_id(_si)=3366437205721944028}]
08-20 15:08:27.201 5140-5176/com.mahmoudradwan.e_news W/zygote: Unsupported class loader
08-20 15:08:27.224 5140-5176/com.mahmoudradwan.e_news W/zygote: Skipping duplicate class check due to unsupported classloader
08-20 15:08:27.236 5140-5176/com.mahmoudradwan.e_news I/DynamiteModule: Considering local module com.google.android.gms.firebase_database:4 and remote module com.google.android.gms.firebase_database:6
08-20 15:08:27.236 5140-5176/com.mahmoudradwan.e_news I/DynamiteModule: Selected remote version of com.google.android.gms.firebase_database, version >= 6
08-20 15:08:27.293 5140-5162/com.mahmoudradwan.e_news V/FA: Connection attempt already in progress
08-20 15:08:27.293 5140-5162/com.mahmoudradwan.e_news V/FA: Connection attempt already in progress
08-20 15:08:27.294 5140-5162/com.mahmoudradwan.e_news V/FA: Activity resumed, time: 5881552
08-20 15:08:27.300 5140-5167/com.mahmoudradwan.e_news D/EGL_emulation: eglMakeCurrent: 0xf19aff60: ver 2 0 (tinfo 0xf199b8a0)
08-20 15:08:27.331 5140-5176/com.mahmoudradwan.e_news W/zygote: Unsupported class loader
08-20 15:08:27.332 5140-5176/com.mahmoudradwan.e_news W/zygote: Skipping duplicate class check due to unsupported classloader
08-20 15:08:27.352 5140-5167/com.mahmoudradwan.e_news D/EGL_emulation: eglMakeCurrent: 0xf19aff60: ver 2 0 (tinfo 0xf199b8a0)
08-20 15:08:27.362 5140-5162/com.mahmoudradwan.e_news D/FA: Connected to remote service
08-20 15:08:27.365 5140-5162/com.mahmoudradwan.e_news V/FA: Processing queued up service tasks: 4
08-20 15:08:27.386 5140-5167/com.mahmoudradwan.e_news D/EGL_emulation: eglMakeCurrent: 0xf19aff60: ver 2 0 (tinfo 0xf199b8a0)
08-20 15:08:27.499 5140-5178/com.mahmoudradwan.e_news D/NetworkSecurityConfig: No Network Security Config specified, using platform default
08-20 15:08:28.848 5140-5145/com.mahmoudradwan.e_news I/zygote: Do partial code cache collection, code=26KB, data=30KB
08-20 15:08:28.849 5140-5145/com.mahmoudradwan.e_news I/zygote: After code cache collection, code=26KB, data=30KB
08-20 15:08:28.849 5140-5145/com.mahmoudradwan.e_news I/zygote: Increasing code cache capacity to 128KB
08-20 15:08:32.509 5140-5162/com.mahmoudradwan.e_news V/FA: Inactivity, disconnecting from the service
08-20 15:08:38.279 5140-5140/com.mahmoudradwan.e_news W/ClassMapper: No setter/field for mImageurl found on class com.mahmoudradwan.e_news.Blog
08-20 15:08:38.280 5140-5140/com.mahmoudradwan.e_news W/ClassMapper: No setter/field for mblogBegginer found on class com.mahmoudradwan.e_news.Blog
08-20 15:08:38.280 5140-5140/com.mahmoudradwan.e_news W/ClassMapper: No setter/field for mtitle found on class com.mahmoudradwan.e_news.Blog
08-20 15:08:38.318 5140-5140/com.mahmoudradwan.e_news W/Glide: Failed to find GeneratedAppGlideModule. You should include an annotationProcessor compile dependency on com.github.bumptech.glide:compiler in your application and a @GlideModule annotated AppGlideModule implementation or LibraryGlideModules will be silently ignored
08-20 15:08:38.402 5140-5140/com.mahmoudradwan.e_news W/Glide: Load failed for null with size [0x0]
                                                               class com.bumptech.glide.load.engine.GlideException: Received null model
08-20 15:08:38.420 5140-5140/com.mahmoudradwan.e_news W/Glide: Load failed for null with size [0x0]
                                                               class com.bumptech.glide.load.engine.GlideException: Received null model

Firebase dataBase Example

{
  "-LKIJ4U5ymhgXyt7A4C2" : {
    "mAudioAdvancedurl" : "com.google.android.gms.tasks.zzu@9f1c1e4",
    "mAudioBegginersurl" : "com.google.android.gms.tasks.zzu@c28a776",
    "mAudioIntermediateurl" : "com.google.android.gms.tasks.zzu@b997177",
    "mImageurl" : "com.google.android.gms.tasks.zzu@2810a11",
    "mblogAdvanced" : "null now",
    "mblogBegginer" : "Hello we test desc yarb t4t8l rbna ystrha",
    "mblogIntermediate" : "null now",
    "mtitle" : "Hello it's a test version title Hi hi ."
  }
}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-08-25 22:16:43

步骤1:从博客类中删除所有static关键字(甚至在方法名删除它之前)。static info

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
     .....
    //listView.setAdapter(adapter); remove this line from here 
     .......
        @Override
        public void onChildAdded(@NonNull DataSnapshot dataSnapshot, @Nullable String s) {
                Blog blog = dataSnapshot.getValue(Blog.class);//also make sure this line is returning a valid result which can be cast to Blog Class
                adapter.add(blog);
                //listView.setAdapter(adapter); or you can call here but not good approach


            }
        .................

    });
 listView.setAdapter(adapter); // call it here

}
}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/52021410

复制
相关文章
【分享】在集简云上架应用如何设置动作字段?
字段是用户要在前端填写的内容,可以在应用授权,设置触发/执行动作时都需要设置,字段在开发后台配置后,用户在使用时可在前端看到对应的字段。
集简云
2022/08/26
1K0
【分享】在集简云上架应用如何设置动作字段?
【分享】在集简云上架应用如何设置动作字段参数?
在开发者平台应用授权和触发/执行字段时都会涉及到字段参数,我们介绍一下各个字段参数的配置。
集简云
2022/08/30
1.1K0
在 Linux 上使用 systemd 设置定时器
定时器增加了另一种启动服务的方式,基于……时间。尽管与定时任务很相似,但 systemd 定时器稍微地灵活一些。让我们看看它是怎么工作的。
用户8989785
2021/09/10
1.7K0
在MacOSX机器上设置JenkinsCI服务器
Jenkins Wiki提供了用于Jenkins安装的选项列表,但没有提及Mac OSX。尽管它提到了Docker,但我只听说过有关Docker的好消息。在本文中,我将坚持使用自制软件。在继续操作之前您需要在Mac上安装和配置JDK。
DevOps云学堂
2020/07/24
2.4K0
在 Laravel Eloquent 模型类zhon设置访问器和修改器
前面两篇教程我们陆续为大家介绍了模型类的基本增删改查操作,以及如何通过模型类进行批量赋值和软删除,今天我们继续为大家介绍模型类的高级特性 —— 访问器和修改器。
学院君
2021/01/22
1.5K0
在腾讯云服务器上如何发布自己的网站
这篇文章教小白怎么在腾讯云服务器上如何发布自己的网站,做一个自己的网站很简单,做一个好站很难
主机优惠教程
2019/04/02
22.6K0
在腾讯云服务器上如何发布自己的网站
反射类的字段
@Test public void test6() throws Exception { Person person = new Person(); Class c1 = Class.forName("com.lan.reflect.Person"); Field f = c1.getField("name"); //获取字段的值 Object value = f.get(person);
MonroeCode
2018/01/11
6370
在Bitbucket Cloud上发布网站
现在可以在yoursitename.bitbucket.io上访问Bitbucket Cloud上托管的静态站点。除了将链接更新为指向https://yoursitename.bitbucket.io之外,静态网站所有者无需执行任何操作。请注意,为了您的安全,bitbucket.io需要HTTPS。
iOSDevLog
2018/08/10
3.1K0
iOS 的系统类信息在栈上?
前言 今天有位群友抛出了一个很有意思的问题:为什么系统类的 class 地址比栈区变量更高? image-20210519235852843 iOS 进程内存布局 通常情况下,我们对进程内存的布局
酷酷的哀殿
2021/06/22
8200
iOS 的系统类信息在栈上?
Oracle 和 Mysql 的索引在Null字段上处理的异同
本文作者系Scott(中文名陈晓辉),ORACLE数据库专家,就职于甲骨文中国。个人主页:segmentfault.com/u/db_perf ,经其本人授权发布。
SQLplusDB
2022/08/22
1K0
ubuntu上找不到wifi适配器,浏览器找不到服务器解决办法
虚拟机学习真是感到很头疼,又遇到火狐浏览器找不到服务器! 解决方案: 把虚拟机先关掉,到编辑:点击虚拟网络编辑器 然后:点击还原默认设置 最后再进入虚拟机就可以上网了!
川川菜鸟
2021/10/18
1.8K0
在 Debian Stretch 上设置自动升级
不少博主,出于安全、稳定的考虑,在自己的服务器上使用了 Debian 操作系统。我们知道,对于多数应用环境,特别是 LNMP 环境,绝大多数安全更新可以自行安装,本文我们将详细介绍,如何在 Debian 环境下自行下载安装最新的系统安全补丁。
Debian中国
2018/12/21
8980
重新整理AUTO_INCREMENT字段
节选择《Netkiller MySQL 手札》 13.9. 重新整理AUTO_INCREMENT字段 AUTO_INCREMENT 并非按照我们意愿,顺序排列,经常会跳过一些数字,例如当插入失败的时候,再次插入会使用新的值。有时会造成浪费,我们可以使用下面SQL重新编排AUTO_INCREMENT序列。 SET @newid=0; UPDATE mytable SET id = (SELECT @newid:=@newid+ 1); 使用max()查看最大值,然后使用 alter修改起始位置。 sele
netkiller old
2018/03/05
7450
net发布的dll方法和类显示注释信息(字段说明信息)[图解]
    自己发布的dll添加的另一个项目中突然没有字段说明信息了,给使用带来了很多的不便,原因是为了跨项目引用,所以导致不显示注释信息的,一下是解决这个问题的方法。     在要发布(被引用)的项目上
磊哥
2018/04/26
8700
net发布的dll方法和类显示注释信息(字段说明信息)[图解]
重新整理AUTO_INCREMENT字段
节选择《Netkiller MySQL 手札》 13.9. 重新整理AUTO_INCREMENT字段 AUTO_INCREMENT 并非按照我们意愿,顺序排列,经常会跳过一些数字,例如当插入失败的时候,再次插入会使用新的值。有时会造成浪费,我们可以使用下面SQL重新编排AUTO_INCREMENT序列。 SET @newid=0; UPDATE mytable SET id = (SELECT @newid:=@newid+ 1); 使用max()查看最大值,然后使用 alter修改起始位置。 sel
netkiller old
2018/03/05
7760
在PyPI上发布自己的Python包(一)
发布PyPI(简单) #0 GitHub https://github.com/Coxhuang/get_time #1 环境 Python3.6 twine==1.13.0 # 需要pip下载 #2 准备 #2.1 注册PyPI账号 https://pypi.org/ #2.2 安装环境 pip3 install twine #3 开始 #3.1 新建文件夹 . ├── get_time # 文件夹 │ └── __init__.py # 把需要发布的代码放到里面 └── setup.py # 配置
Autooooooo
2020/11/09
6430
在PyPI上发布自己的Python包(一)
Java类加载器详解(上)
我们知道,新建一个Java对象的时候,JVM要将这个对象对应的字节码加载到内存中,这个字节码的原始信息存放在classpath(就是我们新建Java工程的bin目录下)指定的目录下的.class文件,类加载需要将.class文件导入到硬盘中,经过一些处理之后变成字节码在加载到内存中。
Java团长
2018/07/23
3990
Java类加载器详解(上)
点击加载更多

相似问题

火基,类文件:在“myclass”上找不到“UserTwo”的设置器/字段

10

在类com.example.mayank.messaging.productDetail上找不到详细信息的设置器/字段

120

在类com.potenza_pvt_ltd.AAPS.TruckDetailsActivity上找不到车辆类型的设置器/字段

16

如何修复在类com.example.chatappfirebase.Model.User上找不到id的设置器/字段?

112

Scala:在类的字段上设置约束

26
添加站长 进交流群

领取专属 10元无门槛券

AI混元助手 在线答疑

扫码加入开发者社群
关注 腾讯云开发者公众号

洞察 腾讯核心技术

剖析业界实践案例

扫码关注腾讯云开发者公众号
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档
查看详情【社区公告】 技术创作特训营有奖征文