m0_60539951 2022-06-16 21:57 采纳率: 0%
浏览 53

Android studio 新闻app闪退打不开

问题遇到的现象和发生背景

Android studio运行一个新闻的app在自己的手机上,但是一直出不来结果一直不断的闪退

问题相关代码,请勿粘贴截图
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">
    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="50dp"
        >
        <ImageView
            android:id="@+id/add_iv_back"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="10dp"
            android:src="@mipmap/bar_img_back"
            android:layout_centerVertical="true"/>
        <TextView
            android:id="@+id/add_tv_title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="频道订阅"
            android:textColor="@color/grey"
            android:layout_centerInParent="true"
            android:textSize="20sp"/>
    </RelativeLayout>
    <ImageView
        android:layout_width="match_parent"
        android:layout_height="1dp"
        android:background="@color/black"/>
    <ListView
        android:id="@+id/add_lv"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:divider="@color/grey"
        android:dividerHeight="1dp"></ListView>
</LinearLayout>

package com.animee.news_info.bean;

public class NewsURL {
//    公共的key   http://v.juhe.cn/toutiao/index?key=0af60a86bfa3575d53c1491d1be310ca&type=top
     public static String key = "0af60a86bfa3575d53c1491d1be310ca";
    public static String info_url = "http://v.juhe.cn/toutiao/index?key="+key+"&type=";
//     头条
     public static String headline_url = info_url +"top";
//    社会
     public static String society_url = info_url +"shehui";
//    国内
     public static String home_url = info_url +"guonei";
//    国际
    public static String internation_url = info_url+"guoji";
//    娱乐
    public static String entertainment_url = info_url+"yule";
//    体育
    public static String sport_url = info_url+"tiyu";
//    军事
    public static String military_url = info_url+"junshi";
//    科技
    public static String science_url = info_url+"keji";
//    财经
    public static String finance_url = info_url+"caijing";
//    时尚
    public static String fashion_url = info_url+"shishang";


}
运行结果及报错内容

闪退

img

我的解答思路和尝试过的方法
我想要达到的结果

请问如何解决这个问题是我的版本问题吗

  • 写回答

2条回答 默认 最新

  • 三杯五岳 2022-06-17 09:48
    关注

    贴一下错误日志,点开这里,然后调试

    img

    评论

报告相同问题?

问题事件

  • 创建了问题 6月16日

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器