我正在使用Tab Layout,我想做两件事:
此外,文字大部分是在图标上而不是在它下面(我可以对它做点什么吗?).
有关如何做到这一点的任何想法?
编辑:我正在以这种方式创建一个新选项卡:
spec = tabHost.newTabSpec("artists").setIndicator(
"Artists",
res.getDrawable(R.drawable.ic_tab_artists)
).setContent(intent);
tabHost.addTab(spec);
Run Code Online (Sandbox Code Playgroud)
我想改变"艺术家"这个词的大小.
我有一些额外的东西发送到一个新的意图.在那里它抓住捆绑并测试它是否是null
.null
即使我能够获得传递的值并使用它们,每次都是这样.
任何人都可以看到if语句有什么问题吗?
Intent i = getIntent();
Bundle b = i.getExtras();
int picked = b.getInt("PICK");
int correct = b.getInt("CORR");
type = b.getString("RAND");
if(b == null || !b.containsKey("WELL")) {
Log.v("BUNDLE", "bun is null");
} else {
Log.v("BUNDLE", "Got bun well");
}
Run Code Online (Sandbox Code Playgroud)
编辑:继承人创建捆绑包的地方.
Intent intent = new Intent(this, app.pack.son.class);
Bundle b = new Bundle();
b.putInt("PICK", pick);
b.putInt("CORR", corr);
b.putString("RAND", "yes");
intent.putExtras(b);
startActivity(intent);
Run Code Online (Sandbox Code Playgroud) 我正在使用新的Facebook-sdk
并使用 hackbook 示例来获取使用文件的朋友列表FriendsList.java
。每次都会Friendlist Activity
被杀死,我在 logcat 中收到此错误:
11-18 16:20:51.141: ERROR/JavaBinder(7881): !!! FAILED BINDER TRANSACTION !!!.
Run Code Online (Sandbox Code Playgroud)
该问题每次都会重现。请注意,个人资料中的好友数量为 4500。
11-18 16:19:27.932: DEBUG/Facebook-Util(7881): GET URL: https://api.facebook.com/restserver.php?access_token=**********&query=select+name%2C+current_location%2C+uid%2C+pic_square+from+user+where+uid+in+%28select+uid2+from+friend+where+uid1%3Dme%28%29%29+order+by+name&method=fql.query&format=json
11-18 16:20:50.982: WARN/InputManagerService(3426): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@4665a200
11-18 16:20:51.141: ERROR/JavaBinder(7881): !!! FAILED BINDER TRANSACTION !!!
Run Code Online (Sandbox Code Playgroud)
请帮忙!
美好的一天,基本上我正在寻找一种方法来检索和保存与 sqlite 数据库中的列项目相关的键值对,以便我可以更新列表视图。
示例:如果我有一个名为“group”的列,其中有一个名为“family”的条目;关于该项目,我希望能够为该项目“家庭”保存或检索联系人列表(姓名和号码)。另一个项目条目相同。
什么是最好的方法来做到这一点?我尝试通过 json 使用 Hashmap 的 ArrayList 将联系人详细信息保存在表格的一列中。但这样做有麻烦。我试过这个:
保存时:
//already have the name and number from using the android contacts api
final ArrayList<HashMap<String,String>> contacts = new ArrayList<HashMap<String,String>>();
HashMap<String, String> map = new HashMap<String,String>();
map.put(name, number);
contacts.add(map);
JSONObject json_contacts = new JSONObject();
try {
json_contacts.put("contacts_Arrays", new JSONArray(contacts));
arraylist_to_string = json_contacts.toString();
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
ContentValues values = new ContentValues();
values.put(ContactDB.GROUP, groupname);
values.put(ContactDB.GROUP_CONTACTS, arraylist_to_string);
Log.d(TAG, "Successfully updating contacts for group");
dbadapter.updateGroup(rowId, …
Run Code Online (Sandbox Code Playgroud) 我真的需要帮助将这种抽屉结合到我的Android应用程序中.
Feinstein滑动菜单抽屉库令人困惑,导致我无法解决的大量错误 - 尤其是即使在取出android支持库时jar也不匹配.所以,我切换到SimonVT的android滑动抽屉库,这看起来更简单(链接在这里).
我只需要知道如何处理这些类型的滑动抽屉的人,就如何将滑动菜单合并到我的应用程序中给出指示.我已经广泛查看了所提供的样本,但它仍然让我感到困惑.我对android编程很新,所以请放心.谢谢!
for (int i=1;i<10;i++)
{
if something == true
do something
else
do something
}
Run Code Online (Sandbox Code Playgroud)
这就是我想要做的事情:在循环之外对于,我需要总结一下我something = true
和哪个我something = false
.
我尝试了一切我可能找到的对齐这个EditText元素 - 但它不会.
我在这里错过了什么?正如你所看到的那样,我试过了两次 android:layout_alignParentRight = "true"
,android:layout_gravity="right"
没有运气.
PS.linearLayout只是父亲中具有RelativeLayout的一个元素,但我想这并不重要.
<LinearLayout android:id="@+id/block1"
android:layout_width="fill_parent"
android:paddingLeft = "4sp"
android:padding = "4sp"
android:layout_height="25sp"
android:layout_marginTop = "4sp"
android:layout_below="@+id/Settings_phoneNumbersLbl"
android:orientation="horizontal">
<TextView android:id="@+id/Settings_phoneNumbersT1"
android:textColor="#000000"
android:textSize="14sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/Settings_phoneNumbersT1"
/>
<EditText android:id="@+id/myRightAlignedText"
android:layout_width="170sp"
android:layout_height="wrap_content"
android:background="@android:drawable/editbox_background"
android:layout_alignParentRight = "true"
android:layout_gravity="right"
/>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud) 我有以下空白
protected void onPaymentSuccess(PaymentResponse response) {
// Stuff...
}
Run Code Online (Sandbox Code Playgroud)
我想在一个空格中保存一个字符串,例如
String key = "JHIJHFEIRUFHEURFGEU5";
Run Code Online (Sandbox Code Playgroud)
我希望能够在手机重启,关闭应用程序后再次检索它(此字符串将保存到手机中).
我是一名java初学者.请帮帮我,这段代码有什么问题:
public class Test {
char[] alfa;
Test(){
alfa = {'a','b'};
}
public static void main(String[] args) {
Test t = new Test();
System.out.println(t.alfa[0]);
}
}
Run Code Online (Sandbox Code Playgroud)
谢谢,
我有一个带有不同启动画面的应用程序。一个是意大利语,一个是英语。如何设置我的应用程序以根据系统语言选择正确的图像?
android ×8
java ×5
bundle ×1
facebook ×1
facebook-fql ×1
for-loop ×1
image ×1
slidingmenu ×1
sqlite ×1