This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Se o elemento não for exibido, mesmo no preview do Android Studio, | |
verificar se não está dentro de um ScrollView |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
View view = getWindow().getDecorView().findViewById(android.R.id.content); | |
/** | |
* Em alguns casos, é interessante ter acesso a view. Eu seto componentes fora da Activity, em outra classe, | |
* para me organizar melhor, e isso foi de grande ajuda (motivo da solução: usar o Butter Knife fora da activity) | |
* / |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Em alguns casos, no do lib de carregamento de imagens Fresco (http://frescolib.org/), é necessário | |
utilizar uri's. Para carregar um recurso local como um URI, segue trecho de código. | |
*/ | |
Uri path = Uri.parse("android.resource://com.yourdomain.yourapp/" + R.drawable.ic_notif_single_tick); | |
/* | |
Onde com.yourdomain.yourapp é o pacote de seu aplicativo. | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sempre setar o Layout Manager | |
recyclerView.setLayoutManager(new LinearLayoutManager(getApplicationContext())); | |
não esquecer nunca. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int seconds = 88200; | |
int secHour = 3600; | |
float val = ( (float) seconds / (float) secHour); | |
System.out.println( val ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://stackoverflow.com/questions/3875184/cant-create-handler-inside-thread-that-has-not-called-looper-prepare | |
http://stackoverflow.com/questions/5009816/cant-create-handler-inside-thread-which-has-not-called-looper-prepare |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final Handler handler = new Handler(){ | |
@Override | |
public void handleMessage(Message msg) { | |
switch(msg.what){ | |
case 0: | |
nextActivity(); | |
progress.dismiss(); | |
} | |
super.handleMessage(msg); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://badlogicgames.com/forum/viewtopic.php?t=19301&p=81023 | |
So I appear to have solved this now...Even though the application was uninstalled from the device for all users, uninstalled via the ADB and did not appear on the list of packages from the ADB, it was still present on the device. On the device, under "Settings -> Apps -> All", at the very bottom was an entry for my application. It was tagged as "Not installed for all users", after selecting it and opening the top-right menu, I could select "Uninstall for all users". For some reason, this fixes the issue. | |
-------------------------------- | |
Quando ocorrer o erro de não ser possível reinstalar o aplicativo via APK. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<LinearLayout | |
android:layout_width="270dp" | |
android:layout_height="wrap_content" | |
android:orientation="vertical" | |
android:gravity="center_vertical" | |
android:background="#993366"> | |
<TextView | |
android:id="@+id/tvTitleActivity" | |
android:layout_gravity="center" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" | |
android:orientation="vertical" | |
android:layout_height="match_parent" | |
tools:context=".MainActivityFragment"> | |
<include layout="@layout/toolbar_main" /> | |
</LinearLayout> |