小编ydn*_*nas的帖子

如何在Android文本视图中使用HTML新行功能?

我在我的Android应用程序中使用webservice.在我的webservice结果中,我获得了一个HTML格式的String作为结果.

假设这是我的Web服务结果:

关于钦奈的书籍:\n

  • 马德拉斯发现,旧马德拉斯和新马德拉斯的故事,马德拉斯(1992年)由S. Muthiah
  • \n
  • 马德拉斯 - 过去和现在(1995年)由S. Muthiah撰写
  • \n
  • 马德拉斯 - 它的昨天和今天以及 S. Muthiah的明天
  • \n
  • 在马德拉斯的家中(1989年),作者是S. Muthiah
  • \n
  • S.Muthiah的Chepauk精神(1998)
  • \n
  • 圣乔治堡(1945年)的故事由Col. DM Reid撰写
  • \n 小说在钦奈 \n
  • SY Krishnaswamy的Kalyani的丈夫
  • \n
  • 在Chennai追逐彩虹(http://chasingrainbowsinchennai.blogspot.com/ \">在Chennai追逐彩虹),(2003)作者:Colin Todhunter
  • \n
  • 在老马德拉斯(1914年)由比西亚玛丽克罗克
  • \n

我使用Html.fromHtml(String)将其添加到我的TextView.但我没有获得新的线路功能.我将其显示为段落.

关于金奈的书籍:发现的马德拉斯,马德拉斯的旧故事,马德拉斯的故事(1992年),作者:S. Muthiah马德拉斯 - 过去和现在(1995年)作者:S. Muthiah马德拉斯 - 其昨天和今天以及明天的S.Muthiah在家中的明天在马德拉斯(1989年)由S. Muthiah撰写的The Chepauk(1998)由S. Muthiah撰写圣乔治堡的故事(1945年)由Col. DM ReidFiction创作于Chennai Kalyani的丈夫由SY Krishnaswamy在金奈追逐彩虹(Chasing Rainbows) in Chennai),(2003)by Colin Todhunter In Old Madras(1914)by Bithia Mary Crocker

如何以易读且易懂的方式呈现此数据?

html android string-formatting

18
推荐指数
2
解决办法
1万
查看次数

在为BB10下载Eclipse插件时没有找到存储库错误

我正在使用这个网站下载eclipse插件来开发Blackberry 10应用程序." http://developer.blackberry.com/android/downloads/eclipseplugin "......

但是当我尝试下载时,我收到此错误

An error occurred while collecting items to be installed session context was:(profile=profile, phase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=, action=). No repository found containing: osgi.bundle,com.android.ide.eclipse.adt,22.2.1.v201309180102-833290 No repository found containing: osgi.bundle,com.android.ide.eclipse.adt.package,22.2.1.v201309180102-833290 No repository found containing: osgi.bundle,com.android.ide.eclipse.base,22.2.1.v201309180102-833290 No repository found containing: osgi.bundle,com.android.ide.eclipse.ddms,22.2.1.v201309180102-833290 No repository found containing: osgi.bundle,overlay.com.android.ide.eclipse.adt.overlay,22.2.1.v201309180102-833290 No repository found containing: org.eclipse.update.feature,com.android.ide.eclipse.adt,22.2.1.v201309180102-833290 No repository found containing: org.eclipse.update.feature,com.android.ide.eclipse.ddms,22.2.1.v201309180102-833290

blackberry blackberry-eclipse-plugin blackberry-10

2
推荐指数
1
解决办法
3227
查看次数

如何在Android中检查字符串中的行数?

我想从要传递给测试视图的字符串中检查文本视图中的行数。我添加了 android:maxLines = "2".... 如果超过两个我需要显示/隐藏视图....我怎样才能做到这一点?

android view textview

2
推荐指数
1
解决办法
2601
查看次数

如何停止在线程池执行器Android中运行的任务

我的项目中有一个异步任务,如下所示.

@SuppressLint("NewApi")

private void callTask() {

    new Task() {

      @Override
      protected void doInBackground(String... params) {

      }
     }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR,
                string1,string2 );
   }
Run Code Online (Sandbox Code Playgroud)

我在for循环中调用这个callTask​​()方法10次​​.

我的任务平行执行,工作正常.我想在一个时间点停止所有任务.我怎样才能做到这一点?

multithreading android threadpool threadpoolexecutor

1
推荐指数
1
解决办法
2210
查看次数

需要在Action Bar Android中隐藏菜单按钮

我想在android中自定义我的操作栏.我创建了一个这样的自定义布局:

<TextView 
    android:id="@+id/actionBarTextView"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Sample"/>    
<ImageView 
    android:id="@+id/actionBarImageView"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:src="@drawable/some_image"/>
Run Code Online (Sandbox Code Playgroud)

我的代码是:

    ActionBar actionBar = getActionBar();
    actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);

    // Do any other config to the action bar
    getActionBar().setDisplayShowTitleEnabled(false);
    getActionBar().setDisplayShowHomeEnabled(false);
    getActionBar().setDisplayHomeAsUpEnabled(false);
    getActionBar().setCustomView(R.layout.custom_action_bar_layout);
Run Code Online (Sandbox Code Playgroud)

我能够在操作栏中看到我的自定义布局,但随后我会在操作栏的最右侧看到菜单图标.我不知道如何删除或隐藏它.请帮助我.

android android-layout android-actionbar

0
推荐指数
1
解决办法
7315
查看次数

如何在Android TextView中将文本右对齐?

我需要在TextView中正确对齐我的文本.图像文本视图右侧缩进文本

怎么做到这一点?

下面是我的layout.xml文件的textview

<TextView
        android:id="@+id/sampleTextView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_above="@+id/dummyTextView"
        android:layout_alignLeft="@+id/dummyTextView"
        android:gravity="right" />
Run Code Online (Sandbox Code Playgroud)

layout android textview

-3
推荐指数
1
解决办法
1233
查看次数