社区
Android
帖子详情
关于android 出现“Unfortunately,程序名 has stopped” 的问题
周盛有
2013-07-20 03:55:15
大家好,我想简单地做一个 UI界面的android应用程序
功能:简单检测字符串功能。 如下图:
连事件都没有写了,就拖完控件之后尝试运行,在android 虚拟机 出现错误 如下图:
为什么会出现错误的?请教各位前辈。
...全文
7896
5
打赏
收藏
关于android 出现“Unfortunately,程序名 has stopped” 的问题
大家好,我想简单地做一个 UI界面的android应用程序 功能:简单检测字符串功能。 如下图: 连事件都没有写了,就拖完控件之后尝试运行,在android 虚拟机 出现错误 如下图: 为什么会出现错误的?请教各位前辈。
复制链接
扫一扫
分享
转发到动态
举报
AI
作业
写回复
配置赞助广告
用AI写文章
5 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
荒颜
2013-07-21
打赏
举报
回复
额 木有log不清楚问题在哪 你的控件没有在代码初始化 但是也没有引用 看下android java教程 学学基本的调试吧 logcat 在eclipse的window->show view -> other -> android -> Logcat
woyaowenzi
2013-07-20
打赏
举报
回复
你的Activity在Menifest.xml中申明了吗?
woyaowenzi
2013-07-20
打赏
举报
回复
1. 打开LogCat窗口:Window-->Show View里面。 2. 一点建议:如果自学,最好从视频学起。
周盛有
2013-07-20
打赏
举报
回复
LogCat 在哪里? 我好像找不到,不好意思,都是自学的,所以知识点有点缺乏。 这个是 main 主程序入口的代码,没有修改过的。 package com.example.frmui; import android.os.Bundle; import android.app.Activity; import android.view.Menu; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } } 这个是activity_main.xml 文件的代码: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context=".MainActivity" > <TextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:layout_marginTop="24dp" android:text="用户名" android:textAppearance="?android:attr/textAppearanceLarge" /> <EditText android:id="@+id/UserName" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:layout_alignTop="@+id/textView1" android:layout_marginRight="17dp" android:ems="10" android:inputType="textPersonName" /> <TextView android:id="@+id/textView2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/UserName" android:layout_marginTop="39dp" android:layout_toLeftOf="@+id/UserName" android:text="密 码" android:textAppearance="?android:attr/textAppearanceLarge" /> <EditText android:id="@+id/PawssWord" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBaseline="@+id/textView2" android:layout_alignBottom="@+id/textView2" android:layout_toRightOf="@+id/textView1" android:ems="10" android:inputType="textPersonName" android:textStyle="bold" /> <Button android:id="@+id/Login" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignLeft="@+id/PawssWord" android:layout_below="@+id/PawssWord" android:layout_marginTop="71dp" android:text="登 陆" android:textColor="@layout/activity_main" /> </RelativeLayout> 没有错误的提示,不然程序是运行不了的,但是有警告的地方,例如:android:text="登 陆" android:text="密 码" android:text="用户名" 这三个地方出现警告。
woyaowenzi
2013-07-20
打赏
举报
回复
你首先应该把LogCat中的红色部分拷贝出来看看。
Android
代码-CustomActivityOnCrash
Custom Activity On Crash library This library allows launching a custom activity when the app crashes, instead of showing the hated "Unfor
tu
nat
ely
, X has
stop
ped
" dialog. How to use One-step install Add the following dependency to your build.gradle: dependencies { compile 'cat.ereza:customactivityoncrash:2.1.0' } ...and you are done! Of course, you can combine this library with any other crash handler such as Crashlytics, ACRA or Firebase, just set them up as you would normally. Try it Forc
安卓学习笔记
安卓学习笔记,对初学者有用。已经是开发者的也可以规范一下。
应用崩溃时启动自定义界面
源码CustomActivityOn,CrashCustomActivityOnCrash是一个
Android
类库,能够在应用崩溃时启动自定义界面,替代胸痛自带的 "Unfor
tu
nat
ely
, X has
stop
ped
" 对话框。仔细想一下,使用场景还很多。
Android
startActivityForResult unfor
tu
nat
ely
程序
名
has
stop
ped
的
问题
文章内容:1.startactivityForResult的使用2.使用中遇到的
问题
3.解决方法1.
Android
中启动其他Activity并返回结果
Android
中提供一个startActivityForResult方法来启动其他的Activity。该方法用于启动指定Activity,而且期望获取指定Activity返回的结果。为了获取被启动的Activity所返回的结果,需要从两个方面入手
android
程序
运行时总
出现
“Unfor
tu
nat
ely
,
程序
名
has
stop
ped
” 的
问题
程序
无误的情况下,总是
出现
这个
问题
是由于
android
API与
Android
80,472
社区成员
91,384
社区内容
发帖
与我相关
我的任务
Android
移动平台 Android
复制链接
扫一扫
分享
社区描述
移动平台 Android
android
android-studio
androidx
技术论坛(原bbs)
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章