Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

General Discussion

How can I do this with Android Studio and I It show s error like Unfortunately Stopped Apllication error while I run app

down vote favorite 1

I want to put an ImageView in my application and then set it to fullscreen.

I had tried following code in androidstudio.(and I tried also in Eclipse IDE)

My minimum required

sdk : API 8:Android 2.2 froyo, taget sdk : API 19:Android 4.4 KitKat, Compile With : API 19:Android 4.4 KitKat, Langauge Level:6.0-ovrrride in interface, Theme:Holo Light With Dark Action Bar. Then in activity_main.xml code is below:

<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="com.example.crystal.app.MainActivity">

<ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/imageView" android:layout_alignParentLeft="true" android:src="@drawable/ddd" />

Where I set theme as Theme.Black.NoTitleBar.Fullscreen.

and I changed AndroidManifest.xml code is below:

<?xml version="1.0" encoding="utf-8"?>

<application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" > <activity android:name="com.example.crystal.app.MainActivity" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.MAIN" />

        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</activity>

</application>

Then I run the Application in AVD but when I open Application it shows the error like "Unfortunately,(app name) has Stopped (and OK button)" So ,What is wrong with my code.