Strange behavior in app that wont play sound unless a Toast line is inserted
Tag : java , By : Adam Hill
Date : March 29 2020, 07:55 AM
seems to work fine May be your file on loading so it can not be play, the Toasts make your load and play delay more. You may need implement setOnLoadCompleteListener and call the play inside the listener. mSoundPool.setOnLoadCompleteListener(new OnLoadCompleteListener()
{
@Override
public void onLoadComplete(SoundPool soundPool, int sampleId,int status) {
mSoundPool.play(sampleId, LEFT_VOLUME, RIGHT_VOLUME, PRIORITY, NO_LOOP, NORMAL_PLAY_RATE);
}
});
|
images wont line up and the text wont go under the img
Date : March 29 2020, 07:55 AM
I wish this helpful for you You need to make the style_title tag your container that defines the rest of it's content. By making it inline-block and styling the inner elements appropriatedly you will get what you need. #content_box {
background-color: #ffffff;
min-width: 100%;
min-height: 75vh;
text-align: center;
overflow-y: auto;
display: inline-block;
}
/* styling for the movie images and titles */
#img {
/*max-width: 60%;
display: inline-block;*/
}
.image_box {
display: inline-block;
width:30%;
}
.style_title
{
display:inline-block;
}
.movie_img {
height: auto;
border-radius: 10px;
display: inline-block;
}
.title {
min-height: 100px;
max-width: 100%;
margin-bottom: 100px;
display: block;
}
<div id="content">
<div id="img">
<a href="link" class="style_title" target="_blank">
<div class="image_box image_id">
<img class="movie_img" src="https://images-na.ssl-images-amazon.com/images/M/MV5BOGNkMzliMGMtMDI5Ni00OTZkLTgyMTYtNzk5ZTY1NjVhYjVmXkEyXkFqcGdeQXVyNTAzMTY4MDA@._V1_UY209_CR0,0,140,209_AL_.jpg">
</div>
<div class="title">The Disaster Artist (2017)</div>
</a>
<a href="link" class="style_title" target="_blank">
<div class="image_box image_id">
<img class="movie_img" src="https://images-na.ssl-images-amazon.com/images/M/MV5BOGNkMzliMGMtMDI5Ni00OTZkLTgyMTYtNzk5ZTY1NjVhYjVmXkEyXkFqcGdeQXVyNTAzMTY4MDA@._V1_UY209_CR0,0,140,209_AL_.jpg">
</div>
<div class="title">The Disaster Artist (2017)</div>
</a>
<a href="link" class="style_title" target="_blank">
<div class="image_box image_id">
<img class="movie_img" src="https://images-na.ssl-images-amazon.com/images/M/MV5BOGNkMzliMGMtMDI5Ni00OTZkLTgyMTYtNzk5ZTY1NjVhYjVmXkEyXkFqcGdeQXVyNTAzMTY4MDA@._V1_UY209_CR0,0,140,209_AL_.jpg">
</div>
<div class="title">The Disaster Artist (2017)</div>
</a>
<a href="link" class="style_title" target="_blank">
<div class="image_box image_id">
<img class="movie_img" src="https://images-na.ssl-images-amazon.com/images/M/MV5BOGNkMzliMGMtMDI5Ni00OTZkLTgyMTYtNzk5ZTY1NjVhYjVmXkEyXkFqcGdeQXVyNTAzMTY4MDA@._V1_UY209_CR0,0,140,209_AL_.jpg">
</div>
<div class="title">The Disaster Artist (2017)</div>
</a>
<a href="link" class="style_title" target="_blank">
<div class="image_box image_id">
<img class="movie_img" src="https://images-na.ssl-images-amazon.com/images/M/MV5BOGNkMzliMGMtMDI5Ni00OTZkLTgyMTYtNzk5ZTY1NjVhYjVmXkEyXkFqcGdeQXVyNTAzMTY4MDA@._V1_UY209_CR0,0,140,209_AL_.jpg">
</div>
<div class="title">The Disaster Artist (2017)</div>
</a>
<a href="link" class="style_title" target="_blank">
<div id="image_id" class="image_box">
<img class="movie_img" src="https://images-na.ssl-images-amazon.com/images/M/MV5BOGNkMzliMGMtMDI5Ni00OTZkLTgyMTYtNzk5ZTY1NjVhYjVmXkEyXkFqcGdeQXVyNTAzMTY4MDA@._V1_UY209_CR0,0,140,209_AL_.jpg">
</div>
<div class="title">The Disaster Artist (2017)</div>
</a>
</div>
</div>
|
Data wont get inserted into database, heisql
Date : March 29 2020, 07:55 AM
like below fixes the issue Beside the ExecuteReader, which should be ExecuteNonQuery(), you are declaring wrong the insert parameters, should not be single quoted. Try: INSERT INTO `user` (Loginname, Email, Algo, Stretch, `Hash`, Salt) VALUES (@loginname, @email, @algo, @stretch, @hash, @salt)
|
SQL query wont return newly added row after hitting the back button despite the row being added in the database
Tag : python , By : Matt Croydon
Date : March 29 2020, 07:55 AM
wish helps you The try block always fails. It fails at this line user_uid = cur_ps.fetchone()[0] if the query returns no rows. It fails at this line user_uid = cur_ps.fetchone()[1] if the query returns one row. fetchone returns one row at a time. This line user_id = cur_ps.fetchone()[0] is looking for element 0 in the list returned by fetchone. If there are no rows with matching user_email, it fails with "None type object not subscriptable" and therefore executes the except block
|
Data is inserted but wont retrieve using Room
Date : March 29 2020, 07:55 AM
this one helps. I forgot to instantiate the adapter in MainActivity.kt adapter = UserAdapter() binding = DataBindingUtil.setContentView(this, R.layout.activity_main)
val dataSource = UserRoomDatabase.getInstance(application).userDao
viewModelFactory = ViewModelFactory(dataSource,application)
viewModel = ViewModelProviders.of(this,viewModelFactory).get(MainActivityViewModel::class.java)
binding.lifecycleOwner = this
binding.mainActivityViewModel = viewModel
binding.executePendingBindings()
adapter = UserAdapter()
binding.userListRecyclerView.adapter = adapter
viewModel.usersList.observe(this, Observer<List<User>> {users ->
users?.apply {
adapter?.userDetailsList = users
}
})
|