after solving buttons succesfully by you guys now im having a problem that the radiobuttongroup aren't showing up this is the code <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android2="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android
在你解决按钮成功后,你们现在我有一个问题,无线电通讯组没有出现 这是代码 <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android2="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" > <LinearLayout android:id="
I'm programming an application on android, and I've a little problem : I would like to make a customiz Dialog box so I do like in the android documentation : In my manifest : <application android:allowBackup="true" android:icon="@drawable/indice" android:label="33" android:theme="@style/AppTheme"> <activity android:name=".Autres.Indice"
我正在编写一个应用程序在android上,我有一个小问题:我想制作一个customiz对话框,所以我喜欢在android文档中: 在我的清单中: <application android:allowBackup="true" android:icon="@drawable/indice" android:label="33" android:theme="@style/AppTheme"> <activity android:name=".Autres.Indice" android:theme="@android:style/Theme.Holo.Dialog">
I have an app with full of custom views. When I try to create a FAB programmatically, it throws an error Caused by: java.lang.IllegalArgumentException: You need to use a Theme.AppCompat theme (or descendant) with the design library. Here is my code. private FloatingActionButton getFAB() { FloatingActionButton fab = new FloatingActionButton(getContext()); fab.setBackgroundDrawable(Co
我有一个充满自定义视图的应用程序。 当我尝试以编程方式创建FAB时,它会引发错误 引起:java.lang.IllegalArgumentException:您需要在设计库中使用Theme.AppCompat主题(或后代)。 这是我的代码。 private FloatingActionButton getFAB() { FloatingActionButton fab = new FloatingActionButton(getContext()); fab.setBackgroundDrawable(ContextCompat.getDrawable(getContext(), R.drawable.ic_add_white_24
I have a ListView wich contains EditText views. When touching these EditText views, the soft key pad comes up (as desired). When using android:windowSoftInputMode="adjustPan" the touch pad hides the bottom part of the ListView and thus possibly the EditText view in focus (just touched). I know that this can be solved by using android:windowSoftInputMode="adjustResize">.
我有一个包含EditText视图的ListView。 触摸这些EditText视图时,会弹出软键盘(根据需要)。 当使用android:windowSoftInputMode =“adjustPan”时,触摸板隐藏了ListView的底部,因此可能隐藏了FocusText中的EditText视图(刚刚触及)。 我知道这可以通过使用android:windowSoftInputMode =“adjustResize”>来解决。 但是,在这种情况下,由于调整EditText视图的大小而失去焦点。 我现在想知道是否有可能让键盘不能隐
I am getting some errors when I am trying to run the hellogridview from the Android website. GridView.java package com.GridView; import android.app.Activity; import android.os.Bundle; public class GridView extends Activity { /** * Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInst
当我尝试从Android网站运行hellogridview时遇到一些错误。 GridView.java 包com.GridView; 导入android.app.Activity; 导入android.os.Bundle; public class GridView extends Activity { /** * Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main);
This question already has an answer here: Stop EditText from gaining focus at Activity startup 46 answers You can make a method and call it on onCreate() method: public static void hideSoftKeyboard (Activity activity, View view) { InputMethodManager imm =(InputMethodManager)activity.getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(view.getApplicationWindowToken()
这个问题在这里已经有了答案: 停止EditText在活动启动时获得焦点46个答案 你可以创建一个方法并在onCreate()方法上调用它: public static void hideSoftKeyboard (Activity activity, View view) { InputMethodManager imm =(InputMethodManager)activity.getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(view.getApplicationWindowToken(), 0);} 或者简单地你可以像这样添加清单文件
This question already has an answer here: Stop EditText from gaining focus at Activity startup 46 answers 您应该将其添加到其父级布局 android:focusable="true" android:focusableInTouchMode="true"
这个问题在这里已经有了答案: 停止EditText在活动启动时获得焦点46个答案 您应该将其添加到其父级布局 android:focusable="true" android:focusableInTouchMode="true"
I have a class called A in package1 and another class called C in package2. Class C extends class A. A has an instance variable which is declared like this: protected int protectedInt = 1; Here is the code for class A package package1; public class A { public int publicInt = 1; private int privateInt = 1; int defaultInt = 1; protected int protectedInt = 1; } And here is
我在package1中有一个名为A的类,而在package2中有一个名为C的类。 C类扩展了A类。 A有一个实例变量,声明如下: protected int protectedInt = 1; 这是A类的代码 package package1; public class A { public int publicInt = 1; private int privateInt = 1; int defaultInt = 1; protected int protectedInt = 1; } 这里是C类的代码: package package2; import package1.A; public class C extend
I have an instance variable in the class Avo, package ger1, with protected modifier. package ger1; public class Avo { protected int i = 1; } Then I have a class Pai which is in package ger2, extends Avo and accesses the variable by instance, so far normal... package ger2; public class Pai extends Avo { public Pai() { i++ } } But Kathy Sierra's book
在类Avo中,我有一个实例变量,包ger1,带有protected修饰符。 package ger1; public class Avo { protected int i = 1; } 然后我有一个Pai包,它在Ger2包中,扩展了Avo并通过实例访问变量,到目前为止正常... package ger2; public class Pai extends Avo { public Pai() { i++ } } 但是Kathy Sierra的书中提到受保护的成员,“一旦子类继承了受保护的成员,那么该成员(由子类继承
This is an interview question. Does subclasses inherit private fields? I answered "No", because we can't access them using the "normal OOP way". But the interviewer thinks that they are inherited, because we can access such fields indirectly or using reflection and they still exist in the object. After I came back, I found the following quote in the javadoc: Priva
这是一个面试问题。 子类是否继承私人领域? 我回答“否”,因为我们无法使用“正常OOP方式”访问它们。 但面试官认为他们是遗传的,因为我们可以间接地或使用反射来访问这些领域,而他们仍然存在于对象中。 在我回来后,我在javadoc中发现了以下引用: 超级中的私人会员 子类不会继承其父类的私有成员。 你知道面试官的意见吗? 这里的问题/答案中的大部分困惑围绕着继承的定义。 显然,正如@DigitalRoss所解释的