android奇葩小问题(1)-onActivityResult获取不到值

查了好多网上的 说什么启动模式之类的,但是和我其他页面的一样,其他页面的是正常的。

好吧,那问题看了就在新启动的acitivity上了,但是我这个activity没什么业务,是一个写评论的页面


情况一:布局问题

将我下面的注释放开,根布局改为linearLayout Listview可以换成ScrollView ,这个时候,就获取不到值,改为现在的就可以获取值,不知道为什么

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/write_comment_root_v"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#50000000"
    >

    <!--<ListView-->
        <!--android:layout_width="match_parent"-->
        <!--android:layout_height="0dp"-->
        <!--android:layout_weight="1">-->

    <!--</ListView>-->

    <!--<RelativeLayout-->
        <!--android:layout_width="match_parent"-->
        <!--android:layout_height="match_parent">-->

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="47dp"
            android:layout_alignParentBottom="true"
            android:background="#f0f0f0">

            <EditText
                android:id="@+id/write_comment_et"
                android:layout_width="match_parent"
                android:layout_height="36dp"
                android:layout_centerInParent="true"
                android:layout_marginLeft="5dp"
                android:layout_marginRight="5dp"
                android:layout_toLeftOf="@+id/write_comment_send_tv"
                android:background="@drawable/shape_rounded_rectangle_write_comment_edit_bg"
                android:gravity="left|center_vertical"
                android:hint="请输入评论"
                android:textColorHint="@color/skin_text_color2"
                android:paddingLeft="8dp"
                android:paddingRight="8dp"
                android:textSize="16dp" />

            <TextView
                android:id="@+id/write_comment_send_tv"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentRight="true"
                android:layout_centerVertical="true"
                android:layout_marginLeft="0dp"
                android:layout_marginRight="5dp"
                android:text="发表"
                android:textSize="15dp"
                android:textColor="@color/black"
                />
        </RelativeLayout>
    <!--</RelativeLayout>-->


</RelativeLayout>

情况二:键盘启动模式问题 

android:windowSoftInputMode

android:windowSoftInputMode="adjustResize"上面的布局,的键盘模式设置为默认的 是可以获取到值的,

但是改为android:windowSoftInputMode="adjustResize" 就获取不到了



具体 各位看业务了

求大牛解惑

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值