textview '\n' not causing carraige return

by NFSpeedypur » Thu, 12 Mar 2009 11:04:20 GMT


Sponsored Links
 I am very confused.  I have brought in data from a database in a
string format.  This data is something like "Hello\nThis is a Test"
But it is not the '\n' as a carriage return and I am not sure why.  If
I add another part to the string with like ... string + "\nHello" it
works fine with the "\n".  So I am assuming that somehow it is
bringing in the \n as 2 characters from the database instead of 1.

I have tried to modify the database to be both varChars and texts for
the column and they both are the same result.  Is there something
straight forward I am missing?


David
--~--~---------~--~----~------------~-------~--~----~



textview '\n' not causing carraige return

by Mark Murphy » Thu, 12 Mar 2009 20:01:52 GMT


 


Bear in mind that "newlines" in Windows are \r\n, whereas in Linux and
OS X they are \n.

I do not know if that relates to your issue, but it's the first thing
that jumps to mind...

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com 
Android Training in Sweden --  http://www.sotrium.com/training.php 

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


textview '\n' not causing carraige return

by NFSpeedypur » Thu, 12 Mar 2009 21:31:11 GMT


 Thats true and I have tested using a \r in there but it is on the
android emulator.  Its just odd because at one point it was working
fine.  I can make a new string and put a \n in and it works fine.  It
just does not like the one that is taken out of the database.  I have
tried both importing in my own database and creating a new one with
one row and both will not work.  Is there a setting on the Textview
that can disable this?

David





--~--~---------~--~----~------------~-------~--~----~



textview '\n' not causing carraige return

by Allan Rogge de Menezes Souza » Fri, 13 Mar 2009 01:47:07 GMT


 I'm a Newbie!!!

And not speak English


ALGUEM PODE ME AJUDAR

HELP ME!!!!

tenho um concurso pra participar e no sei nem o que seja Android ou que
linguagem usar

se for possvel gostaria de obter alguma ideia com vcs aqui
se  que tem brasileiro aqui!
olhei o grupo brasileiro mas no tem nada e os melhores contedos esto aqui
se vcs puderem me ajudar eu agradeo]]



Allan Rogge


Thanks

--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Display locally stored html webpage using webview

Nope, that does not work either.

On Jan 14, 2:50pm, Jason Proctor <jason.android.li...@gmail.com>








> >

2. VerifyError issue with Android 1.5 devices

I got an error message from a user that runs Android 1.5. The error reported
os a java.lang.VerifyError and it seems to be based on the method
setBuildInZoomControls missing. The thing is that this method should be
there on an Android 1.5 device and my app's manifest specifies the minimum
sdk level as "3".

<uses-sdk
android:minSdkVersion="3"
android:targetSdkVersion="4"></uses-sdk>

The documentation for that method says that it is available on level 3:
http://developer.android.com/reference/android/webkit/WebSettings.html#setBuiltInZoomControls(boolean)

So why do I get this error message?

Cheers,
Mariano

Short Excerpt:

01-13 12:08:13.548 I/ActivityManager(   55): Starting activity: Intent {
comp={com.newsrob/com.newsrob.activities.ShowArticleActivity} (has extras) }
*01-13 12:08:13.738 E/dalvikvm(  407): Could not find method
android.webkit.WebSettings.setBuiltInZoomControls, referenced from method
com.newsrob.activities.ShowArticleActivity.createWebView*
01-13 12:08:13.738 W/dalvikvm(  407): VFY: unable to resolve virtual method
248: Landroid/webkit/WebSettings;.setBuiltInZoomControls (Z)V
01-13 12:08:13.738 W/dalvikvm(  407): VFY:  rejecting opcode 0x6e at 0x004c
01-13 12:08:13.738 W/dalvikvm(  407): VFY:  rejected
Lcom/newsrob/activities/ShowArticleActivity;.createWebView
(Landroid/view/View;)V
01-13 12:08:13.738 W/dalvikvm(  407): Verifier rejected class
Lcom/newsrob/activities/ShowArticleActivity;
01-13 12:08:13.768 W/dalvikvm(  407): Class init failed in newInstance call
(Lcom/newsrob/activities/ShowArticleActivity;)
01-13 12:08:13.768 D/AndroidRuntime(  407): Shutting down VM
01-13 12:08:13.768 W/dalvikvm(  407): threadid=3: thread exiting with
uncaught exception (group=0x4000fe70)
01-13 12:08:13.948 E/NewsRob (  407): Caught the following exception:
*01-13 12:08:13.948 E/NewsRob (  407): java.lang.VerifyError:
com.newsrob.activities.ShowArticleActivity*

Longer Excerpt:

01-13 12:08:06.988 D/com.newsrob.AssetContentProvider(  407): onCreate()
01-13 12:08:07.498 D/com.newsrob.storage.SdCardStorageAdapter(  407):
setupMedium status=mounted mounted false->true, read-only false->false,
shared false -> false.
01-13 12:08:07.528 D/NewsRob (  407): NewsRob.onCreate()
01-13 12:08:07.528 D/NewsRobDefaultExceptionHandler(  407): Default
Exception
handler=com.android.internal.os.runtimeinit$uncaughthand...@43680648
01-13 12:08:07.588 W/NewsRob (  407): No debug properties loaded.
01-13 12:08:08.348 W/IInputConnectionWrapper(  101): showStatusIcon on
inactive InputConnection
01-13 12:08:08.448 I/ActivityManager(   55): Displayed activity
com.newsrob/.DashboardListActivity: 2653 ms
01-13 12:08:09.758 I/ActivityManager(   55): Starting activity: Intent {
comp={com.newsrob/com.newsrob.activities.FeedListActivity} (has extras) }
01-13 12:08:10.488 I/ActivityManager(   55): Displayed activity
com.newsrob/.activities.FeedListActivity: 729 ms
01-13 12:08:11.258 I/ActivityManager(   55): Starting activity: Intent {
comp={com.newsrob/com.newsrob.activities.ArticleListActivity} (has extras) }
01-13 12:08:11.848 D/dalvikvm(   55): GC freed 15105 objects / 728320 bytes
in 303ms
01-13 12:08:12.168 D/dalvikvm(  407): GC freed 3444 objects / 199360 bytes
in 123ms
01-13 12:08:12.928 I/ActivityManager(   55): Displayed activity
com.newsrob/.activities.ArticleListActivity: 1665 ms
01-13 12:08:13.548 I/ActivityManager(   55): Starting activity: Intent {
comp={com.newsrob/com.newsrob.activities.ShowArticleActivity} (has extras) }
01-13 12:08:13.738 E/dalvikvm(  407): Could not find method
android.webkit.WebSettings.setBuiltInZoomControls, referenced from method
com.newsrob.activities.ShowArticleActivity.createWebView
01-13 12:08:13.738 W/dalvikvm(  407): VFY: unable to resolve virtual method
248: Landroid/webkit/WebSettings;.setBuiltInZoomControls (Z)V
01-13 12:08:13.738 W/dalvikvm(  407): VFY:  rejecting opcode 0x6e at 0x004c
01-13 12:08:13.738 W/dalvikvm(  407): VFY:  rejected
Lcom/newsrob/activities/ShowArticleActivity;.createWebView
(Landroid/view/View;)V
01-13 12:08:13.738 W/dalvikvm(  407): Verifier rejected class
Lcom/newsrob/activities/ShowArticleActivity;
01-13 12:08:13.768 W/dalvikvm(  407): Class init failed in newInstance call
(Lcom/newsrob/activities/ShowArticleActivity;)
01-13 12:08:13.768 D/AndroidRuntime(  407): Shutting down VM
01-13 12:08:13.768 W/dalvikvm(  407): threadid=3: thread exiting with
uncaught exception (group=0x4000fe70)
01-13 12:08:13.948 E/NewsRob (  407): Caught the following exception:
01-13 12:08:13.948 E/NewsRob (  407): java.lang.VerifyError:
com.newsrob.activities.ShowArticleActivity
01-13 12:08:13.948 E/NewsRob (  407): at
java.lang.Class.newInstanceImpl(Native Method)
01-13 12:08:13.948 E/NewsRob (  407): at
java.lang.Class.newInstance(Class.java:1472)
01-13 12:08:13.948 E/NewsRob (  407): at
android.app.Instrumentation.newActivity(Instrumentation.java:1097)
01-13 12:08:13.948 E/NewsRob (  407): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2183)
01-13 12:08:13.948 E/NewsRob (  407): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2281)
01-13 12:08:13.948 E/NewsRob (  407): at
android.app.ActivityThread.access$1800(ActivityThread.java:112)
01-13 12:08:13.948 E/NewsRob (  407): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1691)
01-13 12:08:13.948 E/NewsRob (  407): at
android.os.Handler.dispatchMessage(Handler.java:99)
01-13 12:08:13.948 E/NewsRob (  407): at
android.os.Looper.loop(Looper.java:123)
01-13 12:08:13.948 E/NewsRob (  407): at
android.app.ActivityThread.main(ActivityThread.java:3928)
01-13 12:08:13.948 E/NewsRob (  407): at
java.lang.reflect.Method.invokeNative(Native Method)
01-13 12:08:13.948 E/NewsRob (  407): at
java.lang.reflect.Method.invoke(Method.java:521)
01-13 12:08:13.948 E/NewsRob (  407): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)
01-13 12:08:13.948 E/NewsRob (  407): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
01-13 12:08:13.948 E/NewsRob (  407): at
dalvik.system.NativeStart.main(Native Method)
01-13 12:08:14.638 I/ActivityManager(   55): Process com.android.mms (pid
124) has died.
01-13 12:08:16.858 I/Resources(  407): Loaded time zone names for en_US in
2588ms.
01-13 12:08:17.068 D/NewsRobDefaultExceptionHandler(  407): Message Body:
Sorry!
01-13 12:08:17.068 D/NewsRobDefaultExceptionHandler(  407):
01-13 12:08:17.068 D/NewsRobDefaultExceptionHandler(  407): NewsRob hit a
wall. Please send this mail, so that the developer can analyze/fix the
issue.
01-13 12:08:17.068 D/NewsRobDefaultExceptionHandler(  407): If it is not too
much to ask, please add to this mail what you just did:
01-13 12:08:17.068 D/NewsRobDefaultExceptionHandler(  407):
01-13 12:08:17.068 D/NewsRobDefaultExceptionHandler(  407): -- Time: Wed Jan
13 12:08:14 GMT+01:00 2010
01-13 12:08:17.068 D/NewsRobDefaultExceptionHandler(  407): -- Android
Version: sdk=3, release=1.5, inc=138607
01-13 12:08:17.068 D/NewsRobDefaultExceptionHandler(  407): -- Memory free:
0,50MB total: 2,94MB max: 16,00MB
01-13 12:08:17.068 D/NewsRobDefaultExceptionHandler(  407): -- Custom ROM:
Stock Android
01-13 12:08:17.068 D/NewsRobDefaultExceptionHandler(  407): -- Device:
sapphire
01-13 12:08:17.068 D/NewsRobDefaultExceptionHandler(  407): -- Model: HTC
Magic
01-13 12:08:17.068 D/NewsRobDefaultExceptionHandler(  407): -- NewsRob
Version: 3.5.2/352
01-13 12:08:17.068 D/NewsRobDefaultExceptionHandler(  407): -- Days
installed:0
01-13 12:08:17.068 D/NewsRobDefaultExceptionHandler(  407): --
Stacktrace:(1006)
01-13 12:08:17.068 D/NewsRobDefaultExceptionHandler(  407):
java.lang.VerifyError: com.newsrob.activities.ShowArticleActivity
01-13 12:08:17.068 D/NewsRobDefaultExceptionHandler(  407): at
java.lang.Class.newInstanceImpl(Native Method)
01-13 12:08:17.068 D/NewsRobDefaultExceptionHandler(  407): at
java.lang.Class.newInstance(Class.java:1472)
01-13 12:08:17.068 D/NewsRobDefaultExceptionHandler(  407): at
android.app.Instrumentation.newActivity(Instrumentation.java:1097)
01-13 12:08:17.068 D/NewsRobDefaultExceptionHandler(  407): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2183)
01-13 12:08:17.068 D/NewsRobDefaultExceptionHandler(  407): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2281)
01-13 12:08:17.068 D/NewsRobDefaultExceptionHandler(  407): at
android.app.ActivityThread.access$1800(ActivityThread.java:112)
01-13 12:08:17.068 D/NewsRobDefaultExceptionHandler(  407): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1691)
01-13 12:08:17.068 D/NewsRobDefaultExceptionHandler(  407): at
android.os.Handler.dispatchMessage(Handler.java:99)
01-13 12:08:17.068 D/NewsRobDefaultExceptionHandler(  407): at
android.os.Looper.loop(Looper.java:123)
01-13 12:08:17.068 D/NewsRobDefaultExceptionHandler(  407): at
android.app.ActivityThread.main(ActivityThread.java:3928)
01-13 12:08:17.068 D/NewsRobDefaultExceptionHandler(  407): at
java.lang.reflect.Method.invokeNative(Native Method)
01-13 12:08:17.068 D/NewsRobDefaultExceptionHandler(  407): at
java.lang.reflect.Method.invoke(Method.java:521)
01-13 12:08:17.068 D/NewsRobDefaultExceptionHandler(  407): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)
01-13 12:08:17.068 D/NewsRobDefaultExceptionHandler(  407): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
01-13 12:08:17.068 D/NewsRobDefaultExceptionHandler(  407): at
dalvik.system.NativeStart.main(Native Method)
01-13 12:08:17.068 E/NewsRobDefaultExceptionHandler(  407): Exception
handled. Email activity should be initiated now.
01-13 12:08:17.078 E/NewsRobDefaultExceptionHandler(  407): Exception
handled. Email should be sent by now.
01-13 12:08:17.088 E/AndroidRuntime(  407): Uncaught handler: thread main
exiting due to uncaught exception
01-13 12:08:17.088 I/ActivityManager(   55): Starting activity: Intent {
action=android.intent.action.SEND type=message/rfc822 flags=0x10000000
comp={com.google.android.gm/com.google.android.gm.ComposeActivityGmail} (has
extras) }
01-13 12:08:17.108 E/AndroidRuntime(  407): java.lang.VerifyError:
com.newsrob.activities.ShowArticleActivity
01-13 12:08:17.108 E/AndroidRuntime(  407): at
java.lang.Class.newInstanceImpl(Native Method)
01-13 12:08:17.108 E/AndroidRuntime(  407): at
java.lang.Class.newInstance(Class.java:1472)
01-13 12:08:17.108 E/AndroidRuntime(  407): at
android.app.Instrumentation.newActivity(Instrumentation.java:1097)
01-13 12:08:17.108 E/AndroidRuntime(  407): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2183)
01-13 12:08:17.108 E/AndroidRuntime(  407): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2281)
01-13 12:08:17.108 E/AndroidRuntime(  407): at
android.app.ActivityThread.access$1800(ActivityThread.java:112)
01-13 12:08:17.108 E/AndroidRuntime(  407): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1691)
01-13 12:08:17.108 E/AndroidRuntime(  407): at
android.os.Handler.dispatchMessage(Handler.java:99)
01-13 12:08:17.108 E/AndroidRuntime(  407): at
android.os.Looper.loop(Looper.java:123)
01-13 12:08:17.108 E/AndroidRuntime(  407): at
android.app.ActivityThread.main(ActivityThread.java:3928)
01-13 12:08:17.108 E/AndroidRuntime(  407): at
java.lang.reflect.Method.invokeNative(Native Method)
01-13 12:08:17.108 E/AndroidRuntime(  407): at
java.lang.reflect.Method.invoke(Method.java:521)
01-13 12:08:17.108 E/AndroidRuntime(  407): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)
01-13 12:08:17.108 E/AndroidRuntime(  407): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
01-13 12:08:17.108 E/AndroidRuntime(  407): at
dalvik.system.NativeStart.main(Native Method)

3. AudioFlinger write blocked for 103 msecs warnings

4. Display locally stored html webpage using webview

5. Time keeping in a game thread

6. Display locally stored html webpage using webview

7. Custom Google Marketplace