我安装了最新版本的SDK(r21)和ADT 21.0.0.我尝试了简单的代码,它运行良好,但现在我在LogCat中收到一个警告,该警告没有出现在以前的版本中:
来自nativeGetEnabledTags的意外值:0
我用Google搜索了,我发现了问题39723:Emulator使用"来自nativeGetEnabledTags:0的意外值"消息阻止LogCat.
这是什么意思?
我想显示性别选择的下拉列表.我传递了一个字符串数组
String arr[]=new String[]{"male","female"};
Run Code Online (Sandbox Code Playgroud)
但问题是显示默认选择的值为,"male"
我想显示"Gender"
为默认值.如果我在位置0的数组中传递"Gender",那么它也会在下拉列表中显示.我只想要"性别"作为提示,但不能在下拉列表中显示.
任何人都可以告诉我如何做到这一点.提前致谢.
我有一个角色:
char ch='A'
Run Code Online (Sandbox Code Playgroud)
给我转换的方法char to ASCII
或返回的方法ASCII NUMBER
.
输出: 65
我试图从以下json对象获取可用数字列表,使用类来自 org.json
{
"response":true,
"state":1,
"data":
{
"CALLERID":"81101099",
"numbers":
[
"21344111","21772917",
"28511113","29274472",
"29843999","29845591",
"30870001","30870089",
"30870090","30870091"
]
}
}
Run Code Online (Sandbox Code Playgroud)
在从Web服务接收到json对象后,我的第一步是:
jsonObj = new JSONObject(response);
jsonData = jsonObj.optJSONObject("data");
Run Code Online (Sandbox Code Playgroud)
现在,如何保存数字的字符串数组?
我试图在Android应用程序中编写AsycTask.在那里我遇到了Integer和Long数据类型,我不确定它们是什么.我尝试使用long
到位Long
,但我在eclipse中遇到错误
'Syntax error on token "long", Dimensions expected after this token'.
Run Code Online (Sandbox Code Playgroud) 我正在尝试编写一个简单的应用程序来捕获ACTION_NEW_OUTGOING_CALL
意图并编写一些调试信息.
这是我的清单:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.android.apis"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/app_name">
<receiver android:name="DialerReceiver" android:exported="false" android:enabled="true">
<intent-filter>
<action android:name="android.intent.action.NEW_OUTGOING_CALL" />
</intent-filter>
</receiver>
</application>
<uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS"></uses-permission>
</manifest>
Run Code Online (Sandbox Code Playgroud)
这是DialerReceiver的代码:
package com.example.android.apis;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
public class DialerReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context arg0, Intent arg1) {
// TODO Auto-generated method stub
debugOut("arg0: " + arg0.toString());
debugOut("arg1: " + arg1.toString());
debugOut("isOrderedBroadcast = " + isOrderedBroadcast());
}
private static void debugOut(String str) {
Log.i("DialerReceiver", …
Run Code Online (Sandbox Code Playgroud) 安装了两个活动,分别在设备上有以下清单文件:
第一个应用程序的活动在其清单中: - 其中,
package="com.example.tictactoe"
<intent-filter>
<action android:name="com.example.tictactoe.YOYO" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/*" />
</intent-filter>
Run Code Online (Sandbox Code Playgroud)
第二个应用程序的活动在其清单中: - 其中,
package="com.example.project"
<intent-filter>
<action android:name="com.example.project.YOYO" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/*" />
</intent-filter>
Run Code Online (Sandbox Code Playgroud)
现在,我想使用以下代码从第三个应用程序启动其中一个活动:
i=new Intent();
i.setAction("YOYO");
i.putExtra("KEY","HII..i am from third app");
startActivity(i);
Run Code Online (Sandbox Code Playgroud)
但执行显示错误: -
03-11 08:12:30.496: E/AndroidRuntime(1744): FATAL EXCEPTION: main
03-11 08:12:30.496: E/AndroidRuntime(1744): android.content.ActivityNotFoundException:
No Activity found to handle Intent { act=ACTION_SEND (has extras) }
Run Code Online (Sandbox Code Playgroud) 我使用以下图标作为我的自定义评级栏:
并使用以下代码:
我的自定义绘图:
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+android:id/background"
android:drawable="@drawable/ic_list_item_wstar" />
<item android:id="@+android:id/secondaryProgress"
android:drawable="@drawable/ic_list_item_wstar" />
<item android:id="@+android:id/progress"
android:drawable="@drawable/ic_list_item_ystar" />
</layer-list>
Run Code Online (Sandbox Code Playgroud)
我的定制风格:
<style name="YellowRatingBar" parent="@android:style/Widget.RatingBar">
<item name="android:progressDrawable">@drawable/ic_ratingbar_yellow</item>
<item name="android:minHeight">22dip</item>
<item name="android:maxHeight">22dip</item>
</style>
Run Code Online (Sandbox Code Playgroud)
我的评级条形码:
<RatingBar
android:id="@+id/ratingBar1"
style="@style/YellowRatingBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:isIndicator="false"
android:rating="3.7" />
Run Code Online (Sandbox Code Playgroud)
但它没有一个好的结果,我的结果如下所示:
编辑
图标的大小为17X17像素。我将最小和最大尺寸设置为17dp
,黑线变小,最后当我将其设置为时,11dp
黑线消失。
为什么我需要将最小和最大尺寸设置为小于图标的实际尺寸?!!
我想删除我在模拟器上为Google API 8级AVD创建的Google帐户.
我尝试将其删除Settings -> Accounts & sync -> Selecting account -> Remove Account
,但我收到此消息,
某些应用程序需要此帐户.您只能通过将手机重置为出厂默认设置来删除它.您可以在"隐私"下的"设置"应用程序中执
我尝试通过转到手机将手机重置为出厂默认设置Settings -> Privacy -> Factory data reset -> Reset data -> Erase everything
,并显示Power Off
消息对话框,无限期进度条以及后来模拟器卡住了.然后,稍后,当我关闭并重新启动模拟器时,该帐户不会被删除.
此外,我想知道是否可以通过代码删除帐户.