Sam
08/28/2020, 2:36 AMjava.io.InterruptedIOException: interrupted
2020-08-28 09:04:45.255 16975-19983/vn.gapo.app W/System.err: at okio.Timeout.throwIfReached(Timeout.kt:98)
2020-08-28 09:04:45.255 16975-19983/vn.gapo.app W/System.err: at okio.InputStreamSource.read(Okio.kt:90)
2020-08-28 09:04:45.255 16975-19983/vn.gapo.app W/System.err: at okio.RealBufferedSink.writeAll(RealBufferedSink.kt:180)
2020-08-28 09:04:45.256 16975-19983/vn.gapo.app W/System.err: at okhttp3.RequestBody$Companion$asRequestBody$1.writeTo(RequestBody.kt:167)
2020-08-28 09:04:45.256 16975-19983/vn.gapo.app W/System.err: at com.gg.gapo.remote.upload.CountingRequestBody.writeTo(CountingRequestBody.kt:26)
2020-08-28 09:04:45.256 16975-19983/vn.gapo.app W/System.err: at okhttp3.MultipartBody.writeOrCountBytes(MultipartBody.kt:157)
2020-08-28 09:04:45.256 16975-19983/vn.gapo.app W/System.err: at okhttp3.MultipartBody.writeTo(MultipartBody.kt:93)
2020-08-28 09:04:45.256 16975-19983/vn.gapo.app W/System.err: at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.kt:59)
2020-08-28 09:04:45.257 16975-19983/vn.gapo.app W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:100)
2020-08-28 09:04:45.257 16975-19983/vn.gapo.app W/System.err: at com.gg.gapo.remote.network.RequestInterceptor.intercept(RequestInterceptor.kt:36)
2020-08-28 09:04:45.257 16975-19983/vn.gapo.app W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:100)
2020-08-28 09:04:45.257 16975-19983/vn.gapo.app W/System.err: at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:34)
2020-08-28 09:04:45.257 16975-19983/vn.gapo.app W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:100)
2020-08-28 09:04:45.257 16975-19983/vn.gapo.app W/System.err: at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:82)
2020-08-28 09:04:45.258 16975-19983/vn.gapo.app W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:100)
2020-08-28 09:04:45.258 16975-19983/vn.gapo.app W/System.err: at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:83)
2020-08-28 09:04:45.258 16975-19983/vn.gapo.app W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:100)
2020-08-28 09:04:45.258 16975-19983/vn.gapo.app W/System.err: at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:74)
2020-08-28 09:04:45.258 16975-19983/vn.gapo.app W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:100)
2020-08-28 09:04:45.258 16975-19983/vn.gapo.app W/System.err: at okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.kt:152)
2020-08-28 09:04:45.258 16975-19983/vn.gapo.app W/System.err: at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:100)
2020-08-28 09:04:45.258 16975-19983/vn.gapo.app W/System.err: at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:197)
2020-08-28 09:04:45.258 16975-19983/vn.gapo.app W/System.err: at okhttp3.internal.connection.RealCall.execute(RealCall.kt:148)
CountingRequestBody for get progressfradiati
08/28/2020, 9:38 AMKevin
08/29/2020, 12:04 PMharoldadmin
08/29/2020, 6:46 PMrank
SQLite function in an FTS4 table query.
SELECT *
FROM launches
JOIN launches_fts ON launches.name = launches_fts.name
WHERE launches_fts MATCH "<query>"
ORDER BY rank(matchinfo(launches_fts));
The launches_fts
table is an FTS4 table, implemented as:
CREATE VIRTUAL TABLE launches_fts USING FTS4(name TEXT NOT NULL, details TEXT, content=launches);
The problem is that whenever I try to run this query, I get the following error:
Result: wrong number of arguments to function rank()
At line 1:
SELECT name
FROM launches_fts
WHERE launches_fts MATCH "*star*"
ORDER BY rank(matchinfo(launches_fts)) DESC;
This query matches the query given in the official documentation here: https://www.sqlite.org/fts3.html#matchinfo
Can someone point out what I'm doing wrong?Archie
08/30/2020, 1:41 PM<style name="MyTheme" parent="Theme.MaterialComponents.DayNight.NoActionBar">
...
<item name="materialButtonStyle">@style/Widget.MyButton</item>
<item name="materialButtonOutlinedStyle">@style/Widget.MyButton.Outlined</item>
...
</style>
<!--Buttons Styles-->
<style name="ThemeOverlay.MyButton" parent="">
...
<item name="colorPrimary">@color/mycolor</item>
<item name="colorOnPrimary">@color/myOnColor</item>
...
</style>
<style name="Widget.MyButton" parent="Widget.MaterialComponents.Button">
<item name="materialThemeOverlay">@style/ThemeOverlay.MyButton</item>
...
</style>
....
But in Jetpack Compose
there is no styles
to set. Is it correct to instead of using the Button
directly, simply create a "`MyButton` " and use it instead like:
@Composable
fun MyButton(
....
modifier = Modifier,
) {
Button(modifier = modifier.backgroundColor(myColor)
....
}
or is there a better and correct way to do this?ZariApps
08/30/2020, 6:55 PMclass ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
init {
itemView.setOnClickListener {
val intent = Intent(itemView.context, ListFragment::class.java)
itemView.context.startActivity(intent)
}
}
}
why is it giving me an error message saying i need to declare fragment into manifest file? is it because of the intent?ZariApps
08/30/2020, 6:56 PMSlackbot
08/31/2020, 10:00 AMMijael Viricochea
08/31/2020, 1:24 PMColton Idle
08/31/2020, 7:39 PMviewModelScope.launch {
var initVal = 100
repeat(100) {
_myViewData.value =
_myViewData.value?.copy(initVal.toString())
initVal--
delay(1000)
}
}
Is there anything really bad with this approach? The only thing I can think of is how would the ViewModel being cleared would affect this.Mehdi Haghgoo
09/01/2020, 8:13 AMclass HelloCodelabViewModel: ViewModel() {
// LiveData holds state which is observed by the UI
// (state flows down from ViewModel)
private val _name = MutableLiveData("")
val name: LiveData<String> = _name
// onNameChanged is an event we're defining that the UI can invoke
// (events flow up from UI)
fun onNameChanged(newName: String) {
_name.value = newName
}
}
class HelloCodeLabActivityWithViewModel : AppCompatActivity() {
val helloViewModel by viewModels<HelloCodelabViewModel>()
override fun onCreate(savedInstanceState: Bundle?) {
/* ... */
binding.textInput.doAfterTextChanged {
helloViewModel.onNameChanged(it.toString())
}
helloViewModel.name.observe(this) { name ->
binding.helloText.text = "Hello, $name"
}
}
}
I have two questions.
1- Why is _name
not defined public so that it can be directly observed rather than through name
?
2- How can name
be modified using observe while it is defined as immutable (val)?Mehdi Haghgoo
09/01/2020, 8:19 AMMohamed Ibrahim
09/01/2020, 8:56 AMmohamadreza jafarzade
09/01/2020, 12:38 PMprivate fun initChat() = GlobalScope.launch {
initConnection()
}
private fun initConnection() {
val config = XMPPTCPConnectionConfiguration.builder()
.setXmppDomain("my domain")
.setHost("my domain")
.setSecurityMode(ConnectionConfiguration.SecurityMode.disabled)
.setCompressionEnabled(false)
.setPort(5280)
.build()
val connection = XMPPTCPConnection(config)
connection.connect()
connection.login()
}
and there are my gradle dependency:
implementation "org.igniterealtime.smack:smack-android:4.3.4"
implementation "org.igniterealtime.smack:smack-tcp:4.3.4"
implementation "org.igniterealtime.smack:smack-extensions:4.3.4"
and i got this error:
org.jivesoftware.smack.SmackException$NoResponseException: No response received within reply timeout. Timeout was 5000ms (~5s). While waiting for establishing TLS
at org.jivesoftware.smack.SynchronizationPoint.checkForResponse(SynchronizationPoint.java:317)
at org.jivesoftware.smack.SynchronizationPoint.checkIfSuccessOrWait(SynchronizationPoint.java:160)
at org.jivesoftware.smack.SynchronizationPoint.checkIfSuccessOrWaitOrThrow(SynchronizationPoint.java:131)
at org.jivesoftware.smack.tcp.XMPPTCPConnection.connectInternal(XMPPTCPConnection.java:977)
at org.jivesoftware.smack.AbstractXMPPConnection.connect(AbstractXMPPConnection.java:435)
at ir.gharar.activities.LiveActivity.initConnection(LiveActivity.kt:78)
at ir.gharar.activities.LiveActivity.access$initConnection(LiveActivity.kt:40)
at ir.gharar.activities.LiveActivity$initChat$1.invokeSuspend(LiveActivity.kt:65)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:738)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
can anyone help me for that?Dvt1405
09/01/2020, 3:27 PMval intent = Intent(context, SplashScreen.class).apply{
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
setAction(Intent.ACTION_MAIN)
intent.addCategory(Intent.CATEGORY_LAUNCHER)
}
startActivity(intent);
but seem it not working. some one can tell me reason why and give me solution for it!?dan.the.man
09/01/2020, 4:54 PMList<T>
?Spikey Sanju
09/01/2020, 6:39 PMparth
09/01/2020, 10:52 PMClass 'FilterOptions' is not abstract and does not implement abstract member public abstract fun describeContents(): Int defined in android.os.Parcelable
but in the generated code…
public FilterOptions(@Nullable String keyword) {
this.keyword = keyword;
}
public int describeContents() {
return 0;
}
what gives?CodeIdeal
09/02/2020, 4:12 AMpublic class CustomView extends View {
public CustomView(Context context) {
this(context,null);
}
public CustomView(Context context, @Nullable AttributeSet attrs) {
this(context, attrs, 0);
}
public CustomView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
//some custom code
}
}
I try init{}
block, but it run before constructor.
class CustomView @JvmOverloads constructor(
context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0
) : View(context, attrs, defStyleAttr) {
init {
// this place is run before super constructor
}
}
Christopher Elías
09/02/2020, 11:07 AMhilt
on an app that is already/ or about to be published?Orhan Tozan
09/02/2020, 1:32 PMService
to a Navigation Component destination (fragment)?Grant Park
09/02/2020, 4:07 PMKen Maffei
09/02/2020, 4:56 PMAnshulupadhyay03
09/03/2020, 5:14 AMIslamdidarmd
09/03/2020, 6:44 AMMijael Viricochea
09/03/2020, 2:01 PM<style name="AppTheme" parent="Theme.MaterialComponents.DayNight.NoActionBar.Bridge">
<item name="colorPrimary">#2f2f2f</item>
<item name="colorPrimaryDark">#2f2f2f</item>
<item name="colorPrimaryVariant">#007038</item>
<item name="colorOnPrimary">#0D1DB1</item>
<item name="colorSecondary">#456321</item>
<item name="colorSecondaryVariant">#965874</item>
<item name="colorOnSecondary">#741080</item>
<item name="colorError">#F44336</item>
<item name="colorOnError">#810000</item>
<item name="colorSurface">#DFDFDF</item>
<item name="colorOnSurface">#CFCFCF</item>
<item name="android:colorBackground">@color/background</item>
<item name="colorOnBackground">#fff</item>
</style>
that is my theme and the result is this
I can't see the hint of the TextInputLayout when it is unselected.Mehdi Haghgoo
09/03/2020, 2:13 PMMuhammad Khalid
09/03/2020, 3:12 PMShreyas Patil
09/03/2020, 4:01 PMwisdom
09/03/2020, 8:18 PM