HJ.我正在使用谷歌地图API v2项目.在我的办公室,它与cert_fingerprint键1一起工作正常
但是在家里做的时候,我得到了一张空白的谷歌地图.跟踪日志我可以看到:
03-17 04:40:44.288 12461-12510/com.dump.dms E/Google Maps Android API:在Google Developer Console(https://console.developers.google.com)中确保"Google Maps Android API" v2"已启用.确保存在以下Android密钥:API密钥:AIzaSyDEE3COcEWPZte_cpPl*********L2Cm_A Android应用程序(<cert_fingerprint>; <package_name>):EF:FA:C1:36:BD:FA:D6:6A: DE:**:**:**:53:C8:8B:16:C1:15:C7:ED; com.dump.dms(调用cert_fingerprint key 2)
所以我必须替换为cert_fingerprint键2.然后我的应用程序正常工作
谁能解释为什么我需要2个cert_fingerprint键呢?我怎样才能只使用一个cert_fingerprint键?
我正在使用RecyclerView Android与左/右消息框建立聊天行.我想将重力设置为RecyclerView的项目.通常情况下,我将itemView转换为LinearLayout,然后为它设置ParamLayout重力.但是如果使用RecyclerView,似乎不适合强制转换为LinearLayout.它将返回RecyclerView.LayoutParams.因为:
RecyclerView子级的LayoutParams子类.鼓励自定义布局管理器创建自己的LayoutParams类的子类,以存储有关布局的任何其他所需的每子视图元数据.
我无法找到使用RecyclerView.LayoutParams设置重力的方法:| 无论如何,任何人都可以在RecyclerView中找到重力项目的方法吗?请建议我.
----------- POST SOLUTION ------------------
// 1.RecyclerView的孩子们
<LinearLayout
android:id="@+id/id_grandparent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:divider="@android:color/transparent"
android:gravity="left"
android:orientation="vertical">
<LinearLayout
android:id="@+id/id_llparent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/bg_customer_feedback_left"
android:gravity="left"
android:orientation="vertical">
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
// 2.OnBindView()
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
params = setLayoutParamsForParent(params, item.isPosition());
holder.llParentLayout.setLayoutParams(params); //corresponding to id_llparent ID
Run Code Online (Sandbox Code Playgroud)
// 3.
private LinearLayout.LayoutParams setLayoutParamsForParent(LinearLayout.LayoutParams params, boolean position) {
params.gravity = position ? Gravity.RIGHT : Gravity.LEFT;
return params;
}
Run Code Online (Sandbox Code Playgroud)