草庐IT

my_custom_method

全部标签

java - 安卓工作室 : Unfortunately "my App" has stopped

我是Android开发新手。编写我的代码并运行调试器后,我的应用程序无法打开,并显示“不幸的是应用程序已停止”。这是我的堆栈跟踪。07-1914:16:07.56210834-10834/com.afiqah.fypE/AndroidRuntime:FATALEXCEPTION:mainProcess:com.afiqah.fyp,PID:10834java.lang.RuntimeException:UnabletostartactivityComponentInfo{com.afiqah.fyp/com.afiqah.fyp.MainActivity}:android.view.I

java - 安卓 + java.lang.NullPointerException : Attempt to invoke interface method

在编译我的代码时出现此错误(“java.lang.NullPointerException:尝试调用接口(interface)方法”),我仍然无法理解原因。这是我的代码:publicclassFragmentDetailsextendsFragment{privateTextViewtext1,text2,text3,text4,text5=null;privateButtonbutton1=null;OnDetailsDefinedListenermCallback;publicinterfaceOnDetailsDefinedListener{voidexecuteOrder(St

android - java.lang.NoSuchMethodError : No static method dispatch Unhandled KeyEvent Pre 错误

当迁移到androidx时,我在返回时遇到上述错误。java.lang.NoSuchMethodError:NostaticmethoddispatchUnhandledKeyEventPre(Landroid/view/View;Landroid/view/KeyEvent;)ZinclassLandroidx/core/view/ViewCompat;oritssuperclasses(declarationof'androidx.core.view.ViewCompat'appearsin1/split_lib_dependencies_apk.apk)atandroidx.ap

android - 工具 :listitem for custom view extending RecyclerView

我尝试使用tools:listitem在RecyclerView上显示正确样式的样本数据。这在使用原始View时效果很好。但是当扩展RecyclerView以创建我自己的自定义View以添加一些功能时,它只会在AndroidStudio的布局预览中显示一个空白区域。如何在扩展View时使用View的所有布局预览内容?我的View如下所示:classTestRecyclerView(context:Context,attrs:AttributeSet?=null,defStyle:Int):RecyclerView(context,attrs,defStyle){}有什么想法吗?

android - 我在使用 android :textSize ="?android:attr/textAppearanceLarge" in my xml 时遇到布局充气器错误

如果我在我的xml中使用android:textSize="?android:attr/textAppearanceLarge",我的应用程序就会崩溃。我不想提供硬编码的文本大小,因为我必须为不同的屏幕大小创建xml,或者我必须在运行时管理文本大小。这是Log.e输出-06-2611:46:27.439:E/AndroidRuntime(1731):atandroid.view.LayoutInflater.createView(LayoutInflater.java:620)06-2611:46:27.439:E/AndroidRuntime(1731):atcom.android.

android.util.AndroidRuntimeException : You cannot combine custom titles with other title features

您好,我的代码出现错误。你能告诉我如何解决这个问题吗?样式代码Activity代码@OverridepublicvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInstanceState);//TosetthecustomtitlewithButtonrequestWindowFeature(Window.FEATURE_CUSTOM_TITLE);setContentView(R.layout.create_account_screen_1);getWindow().setFeatureInt(Window.FEA

android - 使用消息 "method not allowed here"改造响应代码 405

我正在使用改造,我有一个帖子请求interfaceNetworkApi{@Headers("Content-Type:application/json")@POST("/")funstartLoginRequest(@BodyloginModel:LoginModel):CallclassFactory{varretrofit=Retrofit.Builder().baseUrl(BASE_URL).addConverterFactory(GsonConverterFactory.create()).build()companionobject{fungetApi():NetworkA

android - Urban Airship : custom icon for default status bar notification

如果您想对状态栏通知进行任何修改,包括微调图标,UrbanAirship建议使用CustomPushNotificationBuilder创建自定义通知。不幸的是,使用RemoteView进行通知会带来许多与自定义制造商和/或特定于平台的皮肤相关的不良影响,includingtextcolors以及对私有(private)资源的引用(例如Honeycomb/ICS上的@*android:drawable/notify_panel_notification_icon_bg_tile)。必须有一种无需使用RemoteView即可交换图标的简单方法。怎么办? 最佳

安卓 : Custom Pin Marker with buttons in Google Map API 2

我正在开发android跟踪应用程序。我需要在MapView上显示已连接的friend。每个friend标记包含图像(人像)和两个按钮(调用电话和消息)。注意:这两个按钮应该在按下图像后显示。我试试这个样本http://www.nasc.fr/android/android-using-layout-as-custom-marker-on-google-map-api/.它仅显示TextView。有没有什么方法可以通过按钮或任何其他想法添加自定义标记来实现这一点?下图显示了我要添加实时View的mapView。提前致谢 最佳答案 如

Android RecyclerView : Abstract method not implemented

滑动以从Recyclerview中删除项目时应用程序崩溃。错误日志如下。它以前工作现在更新到com.android.support:recyclerview-v7:23.1.0和recyclerview-animators-1.2.2.jar。现在它崩溃了,请帮助我。提前致谢。FATALEXCEPTION:mainProcess:com.timecard,PID:2876java.lang.AbstractMethodError:abstractmethodnotimplementedatandroid.support.v7.widget.RecyclerView$ItemAnimat