yunus emre Çiftçi
09/03/2022, 5:30 PMSubodh Nijsure
09/03/2022, 10:34 PMNelsonC
09/04/2022, 12:22 AMpaulex
09/04/2022, 8:20 PMAaron Waller
09/04/2022, 10:05 PMBen Edwards
09/05/2022, 12:19 PMBen Edwards
09/05/2022, 6:33 PMoverride fun getView(position: Int, convertView: View?, parent: ViewGroup): View {
Log.d(TAG, "getView called pos $position")
// if convertView is null inflate it otherwise use it
val view =
if (convertView == null) {
Log.d(TAG,"getView called with null convertView")
inflater.inflate(resource, parent, false)
} else {
Log.d(TAG,"getView privided a convertView")
convertView
}
val tvName: TextView = view.findViewById(R.id.tvName)
val tvArtist: TextView = view.findViewById(R.id.tvArtist)
val tvSummary: TextView = view.findViewById(R.id.tvSummary)
val currentApp = applications[position] // position from constructor
tvName.text = currentApp.name
tvArtist.text = currentApp.artist
tvSummary.text = currentApp.summary
return view
}
Its the 'val view =' bit I have a question about. I get what it is doing, i.e. only running the inflator if needed. What I don't get is why when the method is run again convertView is set. i.e. when is convertView set to view?gts13
09/05/2022, 7:39 PMAnkit Patel
09/05/2022, 9:22 PMParth Gupta
09/06/2022, 6:18 AMAshish Gautam
09/06/2022, 9:53 AMMaksims Kims
09/06/2022, 11:36 AMShashi K
09/06/2022, 12:23 PMandroid{
packagingOptions {
pickFirst 'lib/x86/libc++_shared.so'
pickFirst 'lib/x86_64/libc++_shared.so'
pickFirst 'lib/armeabi-v7a/libc++_shared.so'
pickFirst 'lib/arm64-v8a/libc++_shared.so'
}
}
The compinlation issue is resolved but when I invoke Zoom API not able find _/libc++_shared.so_Shashi K
09/06/2022, 12:24 PMAaron Waller
09/06/2022, 7:13 PMmartin suchodol
09/07/2022, 8:35 AMval url = "<https://api.openweathermap.org/data/2.5/forecast/daily?q=hamburg,de&appid=33aa634c216259f797f35e862f07****>"
val resultJson = URL(url).readText()
Log.d("Weather Report", resultJson)
val jsonObj = JSONObject(resultJson)
val main = jsonObj.getJSONObject("main")
Attempting to execute then brings up the following:
https://pastebin.com/84EDhwyU
The debug basically did not detect any faults.
Anyway, the bug refers this line:
val resultJson = URL(url).readText()
Edit:
I will add that when I played with it yesterday I somehow mysteriously managed to get the resulting JSON, but only once and without any code modification. It's as if each time the resulting JSON was loaded incorrectlyCiaran Sloan
09/07/2022, 10:01 AMsrc
directory and add your gradle file. Then in the settings.gradle
file add the new module as include ':ui:my-module'
Juliane Lehmann
09/07/2022, 3:34 PMyousef shaaban
09/08/2022, 8:42 AMBilel El Oud
09/08/2022, 9:13 AMSiergej Sobolewski
09/08/2022, 9:18 AMarekolek
09/08/2022, 10:49 AMdetekt
on debug or release build type and why?Jaime
09/08/2022, 10:47 PMandroid.content.ActivityNotFoundException: Unable to find explicit activity class {package/packgae.OtherActivityInFeatureModule}; have you declared this activity in your AndroidManifest.xml?
I was seeing that it is added in the manifest-merge but I still have the error
I am creating the intent like this
fun intentToClear(intentActivity: IntentActivity, bundle: Bundle? = null): Intent {
val intent = Intent(Intent.ACTION_VIEW).setClassName(PACKAGE_NAME, intentActivity.className)
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_NEW_TASK)
bundle?.let {
intent.putExtras(it)
}
return intent
}
Ashish Gautam
09/09/2022, 11:52 AMclass MyFirebaseMessagingService @Inject constructor(private val repository : Repository) :
FirebaseMessagingService() {
martin suchodol
09/11/2022, 8:50 AMUnable to create converter for retrofit2.Call<com.marsuch.weatherapp.network.WeatherInfo>
for method WeatherApiService.getWeatherData
I have found a number of different solutions on the internet however none of them work for me. I use Moshi with retrofit.
My WeatherInfo.kt
data class WeatherInfo (
val city : City,
val cod : Int,
val message : String,
val cnt : Int,
//val list : List<Weather>,
)
data class City (
val id : Int,
val name : String,
//val coord : Coord,
val country : String,
val population : Int,
val timezone: String?
)
WeatherApiServices.kt
import com.squareup.moshi.Moshi
import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
import retrofit2.Call
import retrofit2.Retrofit
import retrofit2.converter.moshi.MoshiConverterFactory
import retrofit2.http.GET
import retrofit2.http.Query
private const val BASE_URL = "<http://api.openweathermap.org/data/2.5/>"
private var lon: String = ""
private var lat: String = ""
private var appId: String = ""
private val moshi = Moshi.Builder()
.add(KotlinJsonAdapterFactory())
.build()
private val retrofit = Retrofit.Builder()
.addConverterFactory(MoshiConverterFactory.create(moshi))
.baseUrl(BASE_URL)
.build()
interface WeatherApiService {
@GET("forecast/daily")
suspend fun getWeatherData(
@Query("lat") lat : String,
@Query("lon") lon : String,
@Query("appid") apiKey : String
): Call<WeatherInfo>
}
object WeatherApi{
val retrofitService : WeatherApiService by lazy {
retrofit.create(WeatherApiService::class.java)
}
}
The resulting data are displayed as follows:
private val _status = MutableLiveData<String>()
fun getData() {
viewModelScope.launch {
try {
val listResult = WeatherApi.retrofitService.getWeatherData(lat, lon, api)
//_status.value = "Success ${listResult} wether data retrieved"
Log.d("Response weather:", listResult.toString())
}
catch (e: Exception) {
_status.value = "Failure: ${e.message}"
Log.e("Failure", e.message.toString())
}
}
}
I'm still learning, so I apologize if the solution to the error is trivial.Eric Womer
09/11/2022, 9:27 PMEric Womer
09/11/2022, 9:27 PMBen Edwards
09/12/2022, 12:10 PMvar data = URL(params[0]).readText()
it hangs(I used a debugger and when it runs the code it just never comes back, the code is in AsyncTask.doInBackground (I know it depreciated, I am doing tutorials). Any advice? The URL is
<https://www.flickr.com/services/feeds/photos_public.gne?tags=android,%20oreo&tagmode=any&format=json&nojsoncallback=1>
This works fine if I just do it in InteliJ.
I know URL is Java but the readText extension is. if it's not enough Kotlinly can someone point me to a good alternative place to ask question?rrg
09/12/2022, 7:03 PMAshish Gautam
09/13/2022, 8:04 AMAshish Gautam
09/13/2022, 8:04 AM