how can I put a newline into a format string

by Mark Murphy » Tue, 09 Mar 2010 04:00:16 GMT


Sponsored Links
 


Out of curiosity -- where are you seeing this list of supported HTML
tags? Html.fromHtml() mentions special handling of <img> but otherwise
does not mention any specific tags it supports. If there is a definitive
list for it, I'd love to know!


Personally, I didn't even realize that existed. Thanks!

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com  |  http://twitter.com/commonsguy 

Android Training...At Your Office:  http://commonsware.com/training 

--



how can I put a newline into a format string

by Mark Murphy » Thu, 11 Mar 2010 11:07:15 GMT


 


10, actually -- 9 on the second page you linked to, plus <img> as
mentioned in Html.fromHtml()'s documentation. And I know that <font>
works, at least for the color attribute, based on some StackOverflow
support issues.

And examining the source code, in addition to the above, I see
references to <div>, <p>, <blockquote>, <font size="" face="">, <em>,
<strong>, <cite>, <dfn>, <h1> through <h6>, ...and <br>. <br> is
supposed to inject \n as a newline.

In a nutshell, the docs are out of sync with the source.

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com  |  http://twitter.com/commonsguy 

_Beginning Android_ from Apress Now Available!

--


Sponsored Links


Other Threads

1. java.lang.RuntimeException: Unable to start activity ComponentInf

When invoke super.onRestoreInstanceState, occur exception.
[Code]
        @Override
        protected void onRestoreInstanceState(Bundle savedInstanceState) {
                Log.d(LOGTAG, "+ onRestoreInstanceState()");

                mFrequency = savedInstanceState.getInt(Constants.CURRENT_FRE);
                mCurrentFre = savedInstanceState.getInt(Constants.CURRENT_FRE);
                mStationName = 
savedInstanceState.getString(Constants.STATION_NAME);

                mStationIndex =
savedInstanceState.getInt(Constants.STATIONPLAY_INDEX,
                        -1);
                mStarCheckBox.setText(mStationName);

                boolean isStaron = savedInstanceState
                        .getBoolean(Constants.CURRENT_STAR);
                mStarCheckBox.setChecked(isStaron);
                if (isStaron) {
                        
mStarCheckBox.setButtonDrawable(R.drawable.starcheckedbtn);
                }
                else {
                        mStarCheckBox.setButtonDrawable(R.drawable.starbtn);
                }

                boolean isRecording = savedInstanceState
                        .getBoolean(Constants.CURRENT_RECORDING);
                // if (isRecording) {
                // startRecord();
                // }
                mOnOrOff = savedInstanceState.getBoolean(Constants.ONOFF_FLAG);
                mHeadSet = 
savedInstanceState.getBoolean(Constants.ONOFF_HeadSet);

                if (mOnOrOff) {
                        turnON();
                        // fmOn();
                }

                mIsBack = true;

                super.onRestoreInstanceState(savedInstanceState);

                Log.d(LOGTAG, "- onRestoreInstanceState()");
        }

[Log]
01-01 08:53:48.560 E/AndroidRuntime( 5107): FATAL EXCEPTION: main
01-01 08:53:48.560 E/AndroidRuntime( 5107):
java.lang.RuntimeException: Unable to start activity
ComponentInfo{com.spreadcomm.fmradio/com.spreadcomm.fmradio.FMRadio}:
java.lang.RuntimeException: Parcel android.os.par...@32aed580:
Unmarshalling unknown type code 51 at offset 492
01-01 08:53:48.560 E/AndroidRuntime( 5107):     at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2663)
01-01 08:53:48.560 E/AndroidRuntime( 5107):     at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
2679)
01-01 08:53:48.560 E/AndroidRuntime( 5107):     at
android.app.ActivityThread.access$2300(ActivityThread.java:125)
01-01 08:53:48.560 E/AndroidRuntime( 5107):     at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
01-01 08:53:48.560 E/AndroidRuntime( 5107):     at
android.os.Handler.dispatchMessage(Handler.java:99)
01-01 08:53:48.560 E/AndroidRuntime( 5107):     at
android.os.Looper.loop(Looper.java:123)
01-01 08:53:48.560 E/AndroidRuntime( 5107):     at
android.app.ActivityThread.main(ActivityThread.java:4627)
01-01 08:53:48.560 E/AndroidRuntime( 5107):     at
java.lang.reflect.Method.invokeNative(Native Method)
01-01 08:53:48.560 E/AndroidRuntime( 5107):     at
java.lang.reflect.Method.invoke(Method.java:521)
01-01 08:53:48.560 E/AndroidRuntime( 5107):     at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:930)
01-01 08:53:48.560 E/AndroidRuntime( 5107):     at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:688)
01-01 08:53:48.560 E/AndroidRuntime( 5107):     at
dalvik.system.NativeStart.main(Native Method)
01-01 08:53:48.560 E/AndroidRuntime( 5107): Caused by:
java.lang.RuntimeException: Parcel android.os.par...@32aed580:
Unmarshalling unknown type code 51 at offset 492
01-01 08:53:48.560 E/AndroidRuntime( 5107):     at
android.os.Parcel.readValue(Parcel.java:1838)
01-01 08:53:48.560 E/AndroidRuntime( 5107):     at
android.os.Parcel.readSparseArrayInternal(Parcel.java:2037)
01-01 08:53:48.560 E/AndroidRuntime( 5107):     at
android.os.Parcel.readSparseArray(Parcel.java:1493)
01-01 08:53:48.560 E/AndroidRuntime( 5107):     at
android.os.Parcel.readValue(Parcel.java:1828)
01-01 08:53:48.560 E/AndroidRuntime( 5107):     at
android.os.Parcel.readMapInternal(Parcel.java:2008)
01-01 08:53:48.560 E/AndroidRuntime( 5107):     at
android.os.Bundle.unparcel(Bundle.java:208)
01-01 08:53:48.560 E/AndroidRuntime( 5107):     at
android.os.Bundle.getSparseParcelableArray(Bundle.java:1167)
01-01 08:53:48.560 E/AndroidRuntime( 5107):     at
com.android.internal.policy.impl.PhoneWindow.restoreHierarchyState(PhoneWindow.java:
1496)
01-01 08:53:48.560 E/AndroidRuntime( 5107):     at
android.app.Activity.onRestoreInstanceState(Activity.java:843)
01-01 08:53:48.560 E/AndroidRuntime( 5107):     at
com.spreadcomm.fmradio.FMRadio.onRestoreInstanceState(FMRadio.java:
867)
01-01 08:53:48.560 E/AndroidRuntime( 5107):     at
android.app.Activity.performRestoreInstanceState(Activity.java:815)
01-01 08:53:48.560 E/AndroidRuntime( 5107):     at
android.app.Instrumentation.callActivityOnRestoreInstanceState(Instrumentation.java:
1096)
01-01 08:53:48.560 E/AndroidRuntime( 5107):     at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2641)

-- 

2. divider for forms

Hello all,

I was following this tutorial to make a simple form and I could make
the form but I am wondering if someone has insights into how I can put
a line divider between each line( row)
http://mobile.tutsplus.com/tutorials/android/android-sdk-creating-forms/

Here is the preview to the final form I got and I am wondering if
someone can help me with some xml attribute which can help the field
one from field 2? Below is the xml file as well.

http://www.flickr.com/photos/34403...@n02/5079751640/

<?xml version="1.0" encoding="utf-8"?>
<ScrollView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/ScrollView01"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:scrollbars="vertical">
    <LinearLayout
        android:layout_width="fill_parent"
        android:orientation="vertical"
        android:layout_height="fill_parent">

<!--Put form controls here-->
<LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:orientation="horizontal">
  <TextView
    android:id="@+id/TextViewTitle"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/edittext1"
    android:textSize="10pt">
</TextView>
<EditText
    android:id="@+id/EditTextName"
    android:layout_height="wrap_content"
    android:hint="@string/feedbackname"
    android:inputType="textPersonName"
    android:singleLine="true"
    android:layout_width="wrap_content">
</EditText>
<Spinner
    android:id="@+id/Spinnercurrency"
    android:layout_height="wrap_content"
    android:prompt="@string/feedbacktype"
    android:layout_width="fill_parent"
    android:entries="@array/currencytypelist">
</Spinner>
</LinearLayout>
<LinearLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:orientation="horizontal">
  <TextView
    android:id="@+id/TextViewTitle"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/edittext2"
    android:textSize="10pt">
</TextView>
<EditText
    android:id="@+id/EditTextEmail"
    android:layout_height="wrap_content"
    android:hint="@string/feedbackemail"
    android:inputType="textEmailAddress"
    android:layout_width="wrap_content">
</EditText>
</LinearLayout>
<LinearLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:orientation="horizontal">
<TextView
    android:id="@+id/TextViewTitle"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/edittext3"
    android:textSize="10pt">
</TextView>
<EditText
    android:id="@+id/EditTextFeedbackBody"
    android:layout_height="wrap_content"
    android:hint="@string/feedbackbody"
    android:inputType="textPersonName"
    android:layout_width="wrap_content">
    </EditText>


</LinearLayout>
<LinearLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:orientation="horizontal">
<TextView
    android:id="@+id/TextViewTitle"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/edittext4"
    android:textSize="10pt">
</TextView>
<EditText
    android:id="@+id/EditTextFeedbackBody"
    android:layout_height="wrap_content"
    android:hint="@string/feedbackbody"
    android:inputType="textPersonName"
    android:layout_width="wrap_content">
    </EditText>
</LinearLayout>
<LinearLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:orientation="horizontal">
<TextView
    android:id="@+id/TextViewTitle"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/edittext5"
    android:textSize="10pt">
</TextView>
</LinearLayout>

<CheckBox
    android:id="@+id/CheckBoxResponse"
    android:layout_height="wrap_content"
    android:text="@string/feedbackresponse"
android:layout_width="wrap_content">
</CheckBox>

<LinearLayout android:id="@+id/Button4"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_alignParentBottom="true"
                android:orientation="horizontal">
                <!-- wrap_content, to have more than one buttons in the same 
line --

                <!-- moved the button here-->
                <Button
                        android:id="@+id/Buttonsubmit"
                        android:layout_width="fill_parent"
                        android:layout_height="wrap_content"
                        android:text="Submit"/>
</LinearLayout>



    </LinearLayout>
</ScrollView>

-- 

3. I need you:an error when call a extends ListActivity class at setContentView(R.layout.setting_time);

4. Need help with created simple GUI

5. my application can't work on 2.2 simulator

6. Do you spend any time sending DMCA notices

7. How to package shared libraries in apk?