我最近更新到谷歌播放服务库版本9.0.0,我不断收到以下logcat消息:
05-19 23:07:30.023 19237-19508/? V/GoogleSignatureVerifier: options.developer.com.developeroptions signature not valid. Found:
Run Code Online (Sandbox Code Playgroud)
虽然我的应用程序没有使用谷歌地图API,但它使用的是分析,广告和谷歌加api.
关于api密钥使用的文档中唯一提到的是使用google maps或android places api.
我还尝试使用正确的密钥添加'com.google.android.geo.API_KEY',但它没有帮助.
这是我的gradle.build文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "options.developer.com.developeroptions"
minSdkVersion 9
targetSdkVersion 23
versionCode 23
versionName "1.06"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile 'com.google.android.gms:play-services-plus:9.0.0'
compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.google.android.gms:play-services-analytics:9.0.0'
compile 'com.google.android.gms:play-services-ads:9.0.0'
}
Run Code Online (Sandbox Code Playgroud) 我有一个片段与EditText
和里面的onCreateView()
我添加TextWatcher
的EditText
.
每次第二次添加片段时,都会afterTextChanged(Editable s)
调用回调,而不会更改文本.
这是一段代码:
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
...
myEditText = (EditText) v.findViewById(R.id.edit_text);
myEditText.addTextChangedListener(textWatcher);
...
}
TextWatcher textWatcher = new TextWatcher() {
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
searchProgressBar.setVisibility(View.INVISIBLE);
}
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void afterTextChanged(Editable s) {
Log.d(TAG, "after text changed");
}
}
Run Code Online (Sandbox Code Playgroud)
我还设置片段以保持其状态,并将片段的实例保留在活动中.
我一直在尝试运行新的Google Maps V2 API的示例项目
并显示一个空白屏幕.
问题是为什么它没有在2.2设备上显示地图,在堆栈跟踪上我看到以下消息:
12-06 09:40:36.039: W/dalvikvm(14657): Unable to resolve superclass of Lmaps/a/du; (411)
12-06 09:40:36.039: W/dalvikvm(14657): Link of class 'Lmaps/a/du;' failed
12-06 09:40:36.039: W/dalvikvm(14657): Unable to resolve superclass of Lmaps/a/ej; (2363)
12-06 09:40:36.039: W/dalvikvm(14657): Link of class 'Lmaps/a/ej;' failed
12-06 09:40:36.039: W/dalvikvm(14657): Unable to resolve superclass of Lmaps/j/k; (2379)
12-06 09:40:36.039: W/dalvikvm(14657): Link of class 'Lmaps/j/k;' failed
12-06 09:40:36.039: E/dalvikvm(14657): Could not find class 'maps.j.k', referenced from method maps.y.ae.a
12-06 09:40:36.039: …
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用a Spring for Android rest client
发送数据http post
,以避免创建和解析json数据.
从他们的手册中,他们有以下方法:
restTemplate.postForObject(url, m, String.class)
Run Code Online (Sandbox Code Playgroud)
调用该方法后,我得到以下异常:
No suitable HttpMessageConverter found when trying to execute restclient request
Run Code Online (Sandbox Code Playgroud)
我的活动代码段是:
RestTemplate restTemplate = new RestTemplate();
restTemplate.getMessageConverters().add(new MappingJacksonHttpMessageConverter());
restTemplate.getMessageConverters().add(new StringHttpMessageConverter());
Message m = new Message();
m.setLibrary("1");
m.setPassword("1395");
m.setUserName("1395");
String result = restTemplate.postForObject(url, m, String.class);
Run Code Online (Sandbox Code Playgroud)
而Message对象是:
public class Message {
private String UserName, Password, Library;
public String getUserName() {
return UserName;
}
public void setUserName(String userName) {
UserName = userName;
}
public String getPassword() …
Run Code Online (Sandbox Code Playgroud) 我正在寻找使用sherlock操作栏的标签导航的最佳做法.更改片段的正确方法是什么,并在选择另一个选项卡时将片段添加到backstack并清除后栈.
是否有任何好的示例或开源项目显示如何正确执行?
如何创建JSONArray,因为创建JSONObject非常简单:
JSONObject j = new JSONObject();
j.put("key",value);
Run Code Online (Sandbox Code Playgroud)
现在我可以在JSONObject中添加另一个字符串,或者在JSONObject的字符串表示中.
但是,如何创建JSONArray并将其插入JSONObject?
我用过这段代码:
function getPicture(){
navigator.camera.getPicture(onSuccess, onFail, {
quality: 50,
destinationType: Camera.DestinationType.FILE_URI,
sourceType : Camera.PictureSourceType.SAVEDPHOTOALBUM
});
}
function onSuccess(imageURI) {
img_uri = imageURI;
alert(img_uri);
Plugin.callNativeFunction(nativePluginResultHandler, nativePluginErrorHandler, 'success', img_uri);
}
Run Code Online (Sandbox Code Playgroud)
我想得到一个像这样的URI:"/ mnt/sdcard/Pictures ..."但警报给了我一个像"content:// media/external/images/media/3915"的URI.
我能做什么?
我有一个内部相对布局有2个图像,当我设置android:layout_marginRight属性时它没有做任何事情.
这是我的代码:
<RelativeLayout
android:id="@+id/location_image_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="80dp" />
<ImageView
android:layout_width="69.33dp"
android:layout_height="72dp"
android:background="@drawable/icon"
android:layout_centerInParent="true" />
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud) 我使用junit断言wicket组件的存在:
wicketTester.assertComponent("dev1WicketId:dev2WicketId:formWicketId", Form.class);
Run Code Online (Sandbox Code Playgroud)
这适用于某些形式.对于复杂的结构,通过搜索所有html文件找出表单的路径是很困难的.有没有什么方法可以轻松找到路径?
使用youtube api
Android 的新功能,当尝试使用YouTubeStandalonePlayer启动活动时, 它会以横向模式显示视频.
Intent youtubeIntent = YouTubeStandalonePlayer.createVideoIntent(context, Configuration.DEVELOPER_KEY, item.getVideo().getId(), 0, true,false);
context.startActivity(youtubeIntent);
Run Code Online (Sandbox Code Playgroud)
我希望视频仍然以全屏显示,但是使用纵向模式.