저는 지금 앱을 개발 (해킹)했는데 지금은 정상적으로 작동하고 있습니다. 필자는 항상 연결된 앱을 구현하려고했기 때문에 사용자가 앱을 실행하거나 위젯 (또는 둘 다)을 추가 할 수 있습니다.위젯 AND app : 간단한 활동 시작시 작동하지 않음
지금까지 주 활동의 onCreate() 메소드에서 Toast를 추가하고 onCreate() 끝에 finish()를 추가하여 Android Studio 내에서 프로젝트를 실행할 때 , 내 장치에서 볼 수있는 모든 성가신 활동보기를 보여주는 빠른 토스트입니다.
이제 응용 프로그램을 사용할 준비가되었습니다. 따라서 토스트를 꺼내서 finish()를 제거했지만 간단하게 "Hello World"TextView를 볼 수 있습니다. 프로젝트 생성)은 더 이상 보여주지 않으며 대신 앱을 실행하려고 할 때 정지됩니다.
나는 왜 이런 일이 일어나고 있는지 전혀 알지 못하지만, 관련된 위젯과 관련된 것으로 의심됩니다.
내에서 onCreate() 메소드는 여전히 매우 간단하다 :
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_my);
}
그리고 activity_my보기 (여전히 주식 "Hello World」의 예) 역시 간단하다 :
<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:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context=".MyActivity">
<TextView
android:text="@string/hello_world"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</RelativeLayout>
어떤 생각 어디 여기에서 가야합니까?
감사합니다. 내 애플 리케이션과 비슷한 문제가 있었는데 이것이 문제였다. – ilikeyoyo