【RxJava RxAndroid WidgetObservable新API】教程文章相关的互联网学习教程文章

java.lang.ClassCastException:android.widget.LinearLayout无法强制转换为android.widget.TextView【代码】

我使用我的应用程序时出现此错误:05-01 14:18:41.000: E/AndroidRuntime(26607): FATAL EXCEPTION: main 05-01 14:18:41.000: E/AndroidRuntime(26607): java.lang.ClassCastException: android.widget.LinearLayout cannot be cast to android.widget.TextView问题的方法:public void onItemClick(AdapterView<?> adapterView, View view, int postion,long index) {// Get MAC adress matching the last 17 characters of the ...

错误:程序类型已存在:android.support.design.widget.CoordinatorLayout $Behavior【代码】

我在构建项目时遇到以下错误.在这个项目中没有使用CoordinatorLayout.刚刚在build.gradle中添加为依赖项: 我使用的是Android Studio 3.2 Canary 4. logcat的AGPBI: {“kind”:”error”,”text”:”Program type already present: android.support.design.widget.CoordinatorLayout$Behavior”,”sources”:[{}],”tool”:”D8″}:app:transformDexArchiveWithExternalLibsDexMergerForDebug FAILEDFAILURE: Build failed with an...

java – Android – android.widget.TabHost无法强制转换为android.support.v4.app.FragmentTabHost【代码】

我是Android的新手.我正在尝试设置一个简单的TabHost视图. 这是我的xml文件:<?xml version="1.0" encoding="UTF-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:tools="http://schemas.android.com/tools"android:layout_width="match_parent"android:layout_height="match_parent" ><TabHostandroid:id="@+id/tabhost"android:layout_width="fill_parent"android:layout_height="fill_pare...

java.lang.ClassCastException:android.widget.LinearLayout无法强制转换为android.support.v7.widget.Toolbar【代码】

我试图在此示例后面的工具栏中添加阴影https://stackoverflow.com/a/26904102/4273056 活动中的工具栏@Override public void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);setSupportActionBar(toolbar); }这是我添加工具栏的xml文件<LinearLayout android:layout_width="wrap_content" android:lay...

Android java.lang.ClassCastException:android.widget.LinearLayout无法强制转换为android.widget.TextView【代码】

我正在尝试打印listView中单击的值,但后来我得到以下异常:07-04 10:40:56.482: E/AndroidRuntime(1356): FATAL EXCEPTION: main 07-04 10:40:56.482: E/AndroidRuntime(1356): java.lang.ClassCastException: android.widget.LinearLayout cannot be cast to android.widget.TextView 07-04 10:40:56.482: E/AndroidRuntime(1356): at com.passwordkeeper.ui.ActivityHomeScreen$1.onItemClick(ActivityHomeScreen.java:...

java – android.support.v7.widget.GridLayout无法实例化【代码】

我正在尝试在我的项目中使用GridLayout,但理想情况下使用Android支持库,因此我可以定位较低版本的API.当我将GridLayout拖到图形布局设计器中时,会弹出一条消息,询问我需要一个14岁以上API版本的兼容性库,并询问我是否要安装此库.我点击了“Install”并让Eclipse做了它的事情,但Eclipse图形布局设计器中出现了一个错误:The following classes could not be instantiated: - android.support.v7.widget.GridLayout See the Error Lo...

java – 渲染android.support.design.widget.CoordinatorLayout的问题【代码】

我将android studio升级到2.2.3后面临问题问题是使用android.support.design.widget.CoordinatorLayout它显示了这个错误The following classes could not be found:– android.support.design.widget.CoordinatorLayout (Fix Build Path, Edit XML, Create Class)– android.support.design.widget.TextInputLayout (Fix Build Path, Edit XML, Create Class) Tip: Try to build the project. Tip: Try torefresh the layout.\ap...

java – 添加ImageView会导致android app widget崩溃【代码】

我正在制作一个非常简单的小部件,使用ImageView显示图像. 我的布局看起来像这样<RelativeLayoutxmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="match_parent"android:layout_height="match_parent"android:padding="16dip"><!-- ImageView logo --><ImageViewandroid:id="@+id/logo"android:src="@drawable/giants"android:contentDescription="@string/app_name"android:layout_width="wrap_c...

android.support.v7.widget.GridLayout上的java.lang.StackOverflowError $Axis $1.walk(GridLayout.java:131【代码】

只有当应用程序运行某些设备时,我才会收到StackOverflowError错误,它可以与其他设备一起使用. 这是堆栈跟踪:java.lang.StackOverflowError at android.support.v7.widget.GridLayout$Axis$1.walk(GridLayout.java:1315) ... ... at android.support.v7.widget.GridLayout$Axis$1.walk(GridLayout.java:1315) at android.support.v7.widget.GridLayout$Axis$1.sort(GridLayout.java:1333) at android.support.v7.widget.GridLayout...

java – 无法获取android.support.v7.widget.SearchView接受文本【代码】

经过几个小时试图在我的支持工具栏中获得支持SearchView才能正常工作(它显示,显示提示文本但拒绝接受文本),我必须转向你. 我用谷歌搜索了几个小时,在这里和其他网站上阅读了很多答案,检查了很多文档和一个处理该主题的特定博客文章,但我无法隔离这个问题. 正如我所说,我使用的是SearchView和Toolbar以及MenuItemCompat的支持版本.另外,ActionBarActivity.我确保我虔诚地遵循了所有步骤(this blog post在这个主题上有很多话要说,甚至...

java导入错误“android.widget.Filter.FilterResults类型不可见”【代码】

这个问题已经被问到:the type android.widget.Filter.FilterResults is not visible但是没有明确的答案,现在我遇到了同样的问题.在那个讨论中,有一些关于变量被标记为final的内容,当它们不应该用于getFilter时……好吧,这是我的代码:package com.example.project;import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.Locale;import android.app.Activity; import android...

android – Widget Pending Intent在应用程序强制停止/杀死后无效【代码】

我有一个小部件,是我的主应用程序的一部分.通常在更新应用程序时,会创建一个PendingIntent,在单击窗口小部件时将用户带到主应用程序中的Activity.但是,当主应用程序由于错误而被OS强制停止或终止时,小部件在单击时停止响应.我相信它也会停止接收广播,因为没有调用onReceive方法. 这是我在清单中的内容:<receiver android:name=".widgets.AppWidget" android:label="@string/widget_name"><intent-filter><action android:name="an...

java – 如何在Android中为android.widget.PopupMenu修复NoClassDefFoundError?【代码】

我正在尝试创建一个弹出菜单,我不断收到java.lang.NoClassDefFoundError:android.widget.PopupMenupublic void showPopup(View v) {PopupMenu popup = new PopupMenu(this, v);MenuInflater inflater = popup.getMenuInflater();inflater.inflate(R.menu.tweet_menu, popup.getMenu());popup.show(); }我意识到这个错误意味着类在编译时在类路径中找到,但不是在运行时,但我无法弄清楚原因,因为这是Android SDK的一部分.我正在使用...

android.widget.ListView/Python/uiautomator script【图】

Get GUI through android-sdk-linux/tools/bin/uiautomatorviewer Python script to automatic click to downlowd all item in android.widget.ListView Refer to https://github.com/xiaocong/uiautomator def percent_to_int(string):if "%" in string:newint = int(string.strip("%")) return newintelse:return int(0)def download_listview_oneitem(): ? ? ##print('Stop all') ? ? ###d(resourceId="com.XXXXX:id/...