Okhelp.cz

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.

webcoreglue(): The real object has been deleted Emulator Error


AD MOB

Error for example:
webcoreglue(2075): The real object has been deleted

Solution:
If this error message shows if orientation the screen is changed
try insert into AndroidManifest.xml this code:
android:configChanges="keyboard|keyboardHidden|orientation"

      <activity
            android:label="@string/app_name"
            android:name=".MyActivity" 
            android:screenOrientation="portrait"
            android:configChanges="keyboard|keyboardHidden|orientation"
            >


397LW NO topic_id




AD

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


208

Zipalign ADT Eclipse | zipalign-adt-eclipse


Zipalign.exe path on Windows:
c:\Program Files\Android\android-sdk-windows\tools\zipalign.exe

zipalign [-f] [-v] <alignment> infile.apk outfile.apk

// command line in Total Commander
zipalign.exe -f -v 4 infile.apk outfile.apk

When using Eclipse with the ADT plugin, the Export Wizard will automatically zipalign your .apk after it signs it with your private key.


How do signs .apk with your private key - image:


signs-apk-with-eclipse-android-1

signs-apk-with-eclipse-android-1

signs-apk-with-eclipse-android-1

signs-apk-with-eclipse-android-1

signs-apk-with-eclipse-android-1

More about Zipalign android.com
40

Spinner ComboBox DropDown set on selected item listener setOnItemSelectedListener Java Android example | spinner-combobox-set-on-selected-item-listener-setonitemselectedlistener-java-android-example


Spinner, ArrayAdapter, setOnItemSelectedListener, onItemSelected, setDropDownViewResource

MainClass.java

public class Vypocet extends Activity {
 Spinner   hSpinnerMetry;
// .......
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

	       hSpinnerMetry = (Spinner) findViewById(R.id.idSpinnerMetry);
	        ArrayAdapter<CharSequence> adapterMetry = ArrayAdapter.createFromResource(
	        		this, R.array.metry_array, android.R.layout.simple_spinner_item);
	        adapterMetry.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
	        hSpinnerMetry.setAdapter(adapterMetry);
			
	           hSpinnerMetry.setOnItemSelectedListener(
	                    new OnItemSelectedListener() {
	                        public void onItemSelected(
	                                AdapterView<?> parent, View view, int position, long id) {
	                        int nPos = position;
	                        }

	                        public void onNothingSelected(AdapterView<?> parent) {
	                        
	                        }
	                    });	        

      }
}



strings.xml


<string-array name="metry_array">
<item>m</item>
<item>dm</item>
<item>cm</item>
<item>mm</item>
</string-array>


61

Get text file content from raw folder to StringBuilder Android example | get-text-file-content-from-raw-folder-to-stringbuilder-android-example


StringBuilder, res/raw folder, try catch finaly throws, BufferedReader, InputStream, openRawResource, getResources Android example

MainActivity.java


public class MainActivity extends Activity {
TextView txtV;
	Context cntx;
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        txtV = (TextView)findViewById(R.id.idLabel);
        cntx = this;
        try {
			StringBuilder strBuilder = myFunction(cntx);
			txtV.setText(strBuilder);
		} catch (IOException e) {
			e.printStackTrace();
		}

        
    }
    
    
    private StringBuilder myFunction(Context context) throws IOException {
        final Resources resources =  context.getResources();
        InputStream inputStream = resources.openRawResource(R.raw.my_file);
        BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
        StringBuilder strBuild = new StringBuilder();
        try {
            String line;
            while ((line = reader.readLine()) != null) {
            	strBuild.append(line);
            }
        } finally {
            reader.close();
        }
       return strBuild; 
       
    }
}

359

Not visible layout changes on testing device | not-visible-layout-changes-on-testing-device


Delete - unistal app from testing device - emulator and try again RUN - DEBUGG your app.
160

Linkify text link url in TextView text Android example | linkify-text-link-url-in-textview-text-android-example


Example from SDK C:\Program Files\Android\android-sdk-windows\samples\android-10\ApiDemos\src\com\example\android\apis\text\Link.java
Source: //developer.android.com/resources/browser.html?tag=sample
License: //www.apache.org/licenses/LICENSE-2.0
1.) Automatically linkifies using android:autoLink="all"

// res/values/strings.xml
<string name="link_text_auto"><b>text1:</b> This is some text.  In
      this text are some things that are actionable.  For instance,
      you can click on //www.google.com and it will launch the
      web browser.  You can click on google.com too.  And, if you
      click on (415) 555-1212 it should dial the phone.
    </string>
// main.xml
<!-- text1 automatically linkifies things like URLs and phone numbers. -->
  <TextView xmlns:android="//schemas.android.com/apk/res/android"
            android:id="@+id/text1"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:autoLink="all"
            android:text="@string/link_text_auto"
            />


2.) Link text by setMovementMethod

// MainActivity.java onCreate
/*Be warned that if you want a TextView with a key listener or movement method not to be focusable, or if you want a TextView without a key listener or movement method to be focusable, you must call setFocusable(boolean) again after calling this to get the focusability back the way you want it. */

TextView t2 = (TextView) findViewById(R.id.text2);
t2.setMovementMethod(LinkMovementMethod.getInstance());

// main.xml
<!-- text2 uses a string resource containing explicit <a> tags to
       specify links. -->
  <TextView xmlns:android="//schemas.android.com/apk/res/android"
            android:id="@+id/text2"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:text="@string/link_text_manual"
            />

//strings.xml

<string name="link_text_manual"><b>text2:</b> This is some other
      text, with a <a href="//www.google.com">link</a> specified
      via an <a> tag.  Use a \"tel:\" URL
      to <a href="tel:4155551212">dial a phone number</a>.
    </string>






3.) Link as html code using Html.fromHtml()

// MainActivity.java onCreate
        TextView t3 = (TextView) findViewById(R.id.text3);
        t3.setText(
            Html.fromHtml(
                "<b>text3:</b>  Text with a " +
                "<a href=\"//www.google.com\">link</a> " +
                "created in the Java source code using HTML."));
        t3.setMovementMethod(LinkMovementMethod.getInstance());




4.) Link string by SpannableString

        SpannableString ss = new SpannableString(
            "text4: Click here to dial the phone.");

        ss.setSpan(new StyleSpan(Typeface.BOLD), 0, 6,
                   Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
        ss.setSpan(new URLSpan("tel:4155551212"), 13, 17,
                   Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);

        TextView t4 = (TextView) findViewById(R.id.text4);
        t4.setText(ss);
        t4.setMovementMethod(LinkMovementMethod.getInstance());


linkify link url adress text in Android


Editace: 2014-02-15 20:33:55
Počet článků v kategorii: 397
Url:webcoreglue-the-real-object-has-been-deleted-emulator-error

AD
11 Share
Share
Tweet