android - Strange dialog with GooglePlayServicesUtil -


i'm checking avalibility of google play services on device. these code:

final int resultcode = googleplayservicesutil.isgoogleplayservicesavailable(this); if (resultcode != connectionresult.success) {  final dialoginterface.oncancellistener cancellistener = new dialoginterface.oncancellistener() {                 @override                 public void oncancel(final dialoginterface dialog) {                     finish();                 }             };             final dialog errordialog = googleplayservicesutil.geterrordialog(                     resultcode, this, google_play_services_request_code, cancellistener             );             errordialog.show(); } 

i resultcode = 2 (it's mean google play services needs update). dialog shown, instead of text, paths layout.

enter image description here

it's looks there interference of resource in app , resource in playservices lib. how it's possible , how avoid id?

since accepted answer unclear, i'll leave signpost conclusions (mostly extracted comments on question) believe correct.

short version: seems resource ids incorrectly generated app.

it's obvious google play services dialog intended show strings in places. geterrordialog() method implemented (obfuscated, meaning can still understood):

... case 1:      return localbuilder.settitle(r.string.common_google_play_services_install_title).create(); case 3:      return localbuilder.settitle(r.string.common_google_play_services_enable_title).create(); case 2:     return localbuilder.settitle(r.string.common_google_play_services_update_title).create(); ... 

also, mistakenly doing getresources().getstring(r.layout.my_layout) return string name of original resource file ("res/layout/my_layout.xml").

so, can conclude that, reason, value of play services library resource, say, com.google.android.gms.r.string.common_google_play_services_install_title same resource r.layout.dialog_share in application project.

this stems incorrect build process, or incorrect usage of google play services library (for example, including jar directly, without corresponding library process).


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -