textview

trying to make a text console with 40 columns or characters

痞子三分冷 提交于 2020-01-16 08:39:10
问题 I am extending a MultiAutoCompleteTextView and I have the font set to this font Unicode font here is the xml where I declare it <jacs.apps.jacs.CustomViews.Console android:id="@+id/auto" android:layout_width="match_parent" android:layout_height="wrap_content" android:dropDownAnchor="@id/content_frame" android:dropDownHeight="100dp" android:layout_weight="1" android:gravity="bottom" android:inputType="textMultiLine|textNoSuggestions" android:fontFamily="@font/unifont" android:imeOptions=

How to place a text between two straight line android?

假装没事ソ 提交于 2020-01-16 04:54:06
问题 I need to place a text between a straight line. I tried by using view but textview comes below the line. How to solve this? My code is as follows: <RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="10dp" > <View android:layout_width="wrap_content" android:layout_height="2dp" android:layout_alignParentLeft="true" android:layout_toLeftOf="@+id/orText" android:background="#c0c0c0"/> <View android:layout_width="wrap_content" android

Widget stops updating after a few minutes

半世苍凉 提交于 2020-01-15 11:43:38
问题 Im developing a widget that shows the time and date using two TextView using a timer to update every second: final Handler handler = new Handler(); Timer timer = new Timer(); timer.scheduleAtFixedRate(new TimerTask() { @Override public void run() { handler.post(new Runnable() { public void run() { java.util.Date noteTS = Calendar.getInstance().getTime(); String time = "kk:mm"; String date = "dd MMMMM yyyy"; views.setTextViewText(R.id.tvTime, DateFormat.format(time, noteTS)); views

Widget stops updating after a few minutes

大城市里の小女人 提交于 2020-01-15 11:43:07
问题 Im developing a widget that shows the time and date using two TextView using a timer to update every second: final Handler handler = new Handler(); Timer timer = new Timer(); timer.scheduleAtFixedRate(new TimerTask() { @Override public void run() { handler.post(new Runnable() { public void run() { java.util.Date noteTS = Calendar.getInstance().getTime(); String time = "kk:mm"; String date = "dd MMMMM yyyy"; views.setTextViewText(R.id.tvTime, DateFormat.format(time, noteTS)); views

Custom Textview with Html text and Custom Font whole Android application

核能气质少年 提交于 2020-01-15 11:21:49
问题 I have created a custom textview to set the custom font and to set the html text for whole application. Because my app has both the functions in many places. In this case, i can able to set the custom font to whole android application it works great. but failed to apply html text for custom textview. Limitations i have: I do not want to get the textview and use setText(Html.fromHtml("Some text")) . It is working when i using this in code but i want to use the text in strings.xml as <string

Android JavascriptInterface problem

无人久伴 提交于 2020-01-15 09:11:40
问题 I am an Android beginner. I am trying to change a textview value in an activity in a webview javascript call to javascript interface class. There is a webview and a textview in the activity layout. MyWebActivity public class MyWebActivity extends Activity { ... public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); String url = "http://myurl..."; webview = (WebView) findViewById(R.id.webview); webview.getSettings()

Change TextView in MainActvity from RecyclerAdapter using Kotlin

只谈情不闲聊 提交于 2020-01-15 09:11:24
问题 I want to change the text in a TextView (id: dailyTotalTextView) in MainActivity, when I click a button in a RecyclerView. But I get an error saying dailyTotalTextView must not be null. I have a basic knowledge of Kotlin and no Java experience, so I might be going all wrong about this. The TextView displays the sum of values in a list. The list items contain a number and a button to delete the item. When I delete an item I want the TextView to change the total. In MainActivity an item can be

Android JavascriptInterface problem

送分小仙女□ 提交于 2020-01-15 09:10:11
问题 I am an Android beginner. I am trying to change a textview value in an activity in a webview javascript call to javascript interface class. There is a webview and a textview in the activity layout. MyWebActivity public class MyWebActivity extends Activity { ... public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); String url = "http://myurl..."; webview = (WebView) findViewById(R.id.webview); webview.getSettings()

Change TextView in MainActvity from RecyclerAdapter using Kotlin

我怕爱的太早我们不能终老 提交于 2020-01-15 09:08:31
问题 I want to change the text in a TextView (id: dailyTotalTextView) in MainActivity, when I click a button in a RecyclerView. But I get an error saying dailyTotalTextView must not be null. I have a basic knowledge of Kotlin and no Java experience, so I might be going all wrong about this. The TextView displays the sum of values in a list. The list items contain a number and a button to delete the item. When I delete an item I want the TextView to change the total. In MainActivity an item can be

How to Zoom a Text View in Scroll View?

↘锁芯ラ 提交于 2020-01-15 09:02:19
问题 I have seen a lots of code here which is helpful to zoom your textview but none of them work with my text because it is within scrollview . How can I get rid of this problem? import android.app.Activity; import android.os.Bundle; import android.MotionEvent; import android.view.View; import android.view.View.OnTouchListener; import android.widget.TextView; public class Introduce extends Activity implements OnTouchListener{ final static float STEP = 200; TextView mtxtRatio1,mtxtRatio2