Recepty, články, nápady, programování. Dříve dum-zahrada, finance, internet a know-how.okhelp.cz Pro lepší výsledky hledání používejte i diakritiku.

ADB restart device every time Android Studio


Android Studio ADB restart mobile device from USB every time if RUN of DEBUG button pressed

Try to close the mobile application on your device completely before starting again from Android Studio.
Close every fragment.
The problem occurs when the application has multiple fragments.

Date: 13.07.2020 - 08:23

397LW NO topic_id


Další témata ....(Topics)


How set text to TextView as HTM HTML format Android example | how-set-text-to-textview-as-htm-html-format-android-example

Html.fromHtml(), setText(), textView.setText(Html.fromHtml(String htmlFormat)), Android example.

TextView mIdTextOk = (TextView)findViewById(R.id.idTextOk);
int _nOk = 57;
// number 57 will bold style
mIdTextOk.setText(Html.fromHtml( "OK: "+"<b>"+_nOk+"</b>")); 

No resource found that matches the given name Eclipse Android xml file | no-resource-found-that-matches-the-given-name-eclipse-android-xml-file

No resource found that matches the given name - error examples.
Exist resource file?
Is code written correctly?

// No resource found that matches the given name (at id with value @id/myButton).
 android:id="@id/myButton" // invalid id notation
 android:id="@+id/myButton" // correct

 // No resource found that matches the given name 
// (at icon with value @drawable/icons).
// exist file icons in res/drawable folder?
<application android:icon="@drawable/icons" 

//No resource found that matches the given name 
//(at theme with value @style/MyThem).
<activity android:name=".Main"

// Exist style MyThem  in styles.xml ?  No only MyTheme
<style name="MyTheme" parent="android:Theme">
        <item name="android:windowTitleSize">50px</item>

// exist file my_background in folder drawable ?
android:background="@drawable/my_background" // 

// no resource found that matches the given name(at "label" with value "@string/app_name")
// have you the string resource defined in res/values/strings.xml ?
<string name="app_name">"My App"</string>


Drawable Bitmap get width height Android | drawable-bitmap-get-width-height-android

		Drawable dr = getResources().getDrawable(R.drawable.algebra);
		int h = dr.getIntrinsicHeight();
		int w = dr.getIntrinsicWidth();

		Bitmap ball = BitmapFactory.decodeResource(getResources(), R.drawable.algebra);
		int _nWidth = ball.getWidth();
		int _nHeight = ball.getHeight();


EditText text changed java Android | edittext-text-changed

Google Android example source code - is text changed in EditText ?

EditText hEditText;

// TextChanged in onCreate
hEditText = (EditText)findViewById(R.id.idEditText);
hEditText.addTextChangedListener(new TextWatcher() {
public void afterTextChanged(Editable str) {

public void beforeTextChanged(CharSequence s, int start, int count,
int after) {

public void onTextChanged(CharSequence sq, int start, int before,
int count) {

android - OnClickListener must override a superclass method | android-onclicklistener-must-override-a-superclass-method

The method onClick(DialogInterface, int) of type new DialogInterface.OnClickListener(){} must override a superclass method.

Try this:
Right click on project
Select Properties
In open dialogue select Java compiler
Set Enable project specific settings
Set Compiler compliance level to 1.6



Editace: 14.7.2020 - 11:45
Počet článků v kategorii: 397

11 Share