[英]Why my android program works fine on 4.4.3 version but doesnt work on 10.0
[英]Why android program doesnt work on my phone( it work on virtual phone fine)
try {
val adresstext= findViewById(R.id.editText3)as TextView
fusedLocationClient = LocationServices.getFusedLocationProviderClient(this)
fusedLocationClient.lastLocation.addOnSuccessListener {
location -> location
var locationx=location.longitude
var locationy=location.latitude
val name = findViewById(R.id.textView) as TextView
name.text=(locationx.toString()+" "+locationy.toString())
var geocoder: Geocoder
var listadress :List<Address>
geocoder = Geocoder(this, Locale.getDefault());
listadress =geocoder.getFromLocation(locationy,locationx,1)
var adress=listadress[0].getAddressLine(0)
var city =listadress[0].locality.get(0)
var state = listadress[0].adminArea.get(0)
var country = listadress[0].getCountryName()
var postalCode = listadress[0].getPostalCode()
var knownName = listadress[0].getFeatureName()
adresstext.text=(adress+city+state+country+postalCode+knownName)
}
}
catch (e: java.lang.Exception)
{
Toast.makeText(this,e.toString(),Toast.LENGTH_LONG).show()
}
那是我的代码,当我在模拟器中运行它时它可以正常工作,没有错误但是当我用我的手机运行它时(我将它连接到我的电脑)按钮不起作用,它说:
V/AudioManager: querySoundEffectsEnabled...
D/AwareBitmapCacher: handleInit switch not opened pid=19134
在此之前,当程序在我的手机中打开时,运行部分如下:
E/: APS:IFLoad:importExternalFunctions, search function createNewHwApsUtils failed, dlsym err:undefined symbol: createNewHwApsUtils
E/AwareLog: AtomicFileUtils: readFileLines file not exist: android.util.AtomicFile@6c8edde
E/AwareLog: AtomicFileUtils: readFileLines file not exist: android.util.AtomicFile@3bb1bbf
这 3 个是红色的 我该如何解决这个问题?
您应该转到电话设置并找到您的应用程序。 检查位置服务是允许的。 如果不允许。 接受这一点。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.