Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6989265
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:11:22+00:00 2026-05-27T19:11:22+00:00

I am working with modified version of sample WeatherListWidget to get a better understanding

  • 0

I am working with modified version of sample WeatherListWidget to get a better understanding of App Widgets. Things are fine – except when I try to replace the dark_widget_item and light_widget_item layout files with slightly more complex layout files. Here is original layout:

<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/widget_item"
android:layout_width="match_parent"
android:layout_height="46dp"
android:paddingLeft="25dp"
android:gravity="center_vertical"
android:background="@drawable/item_bg_light"
android:textColor="#e5e5e1"
android:textSize="24sp" />

I would like to be able to have multiple text lines. But:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/widget_item"
android:background="@drawable/item_bg"
android:layout_width="match_parent"
android:layout_height="46dp"
android:paddingLeft="25dp">
<TextView android:id="@+id/type_string"
    android:textColor="#666666"
    android:textSize="20sp" />
<TextView android:id="@+id/title_string"
    android:textColor="#666666"
    android:textSize="18sp" />
</LinearLayout>

fails.

In fact, it results in “Sorry! The application Launcher (process com.android.launcher) has stopped unexpectedly. Please try again. Force close”.

Reinstating TextView widget_item.xml fixes this. I suspect that part of the problem is how I reference RemoteViews in WeatherWidgetService.getViewAt() – but I am getting very little help from DDMS or LogCat or anything else.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T19:11:23+00:00Added an answer on May 27, 2026 at 7:11 pm

    Thanks guys, I got the notification. (SO requires a username with length > 2, hence the dot)

    Answer as per comment:
    I don’t see any layout_width and layout_height attributes for both of the TextViews in your LinearLayout – they are mandatory. Also, if you want the two TextViews to be above eachother, add android:orientation="vertical" to the LinearLayout. And just to the record, you can break a CharSequence to multiple lines in a single TextView by adding “\n” inbetween the different elements.

    If you’re going to include an image as well, then you’re probably better off with a LinearLayout than a single TextView indeed, although you could potentially use the intrinsic drawable option of the latter. That could get a little messy though, especially if you’re planning on using different styles for the different lines of text… Not impossible, but I’d stick with the LinearLayout. 😉

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How do I get the OpenGL color matrix transforms working? I've modified a sample
I have tried. My working copy is based on but a modified version of
I'm using a modified version on juno ( http://github.com/breily/juno/ ) in Google App Engine.
I'm working in a modified version of Sybase 10 that doesn't have the stuff,
I have modified a working Windows service that had always been starting beforehand. After
We are working on a large project with a measure of new/modified GUI functionality.
I create a working repository in HG. And I have modified some files. How
I have downloaded some sample source codes, modified them and made a audio-video player.
I used a slightly modified version of Ryan Scherf's jQuery swipe plugin on a
I am using a slightly modified version of this code . to create a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.