Já tentei várias coisas mas não consigo manter o estado (hide/show) após a rotação. Só lembrando que o edittext está dentro de um fragment.
Desde já, obrigado.
--
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Thiago, eu to ligado no processo de recriação da activity na rotação, o que eu nao consigo eh manter o estado do teclado aberto ou fechado. Eu não consegui obter o estado do teclado e tb nao esta nem funcionando a tentativa de abri-lo depois da recriação. Nao ta dando nada certo entao eu resolvi pedir ajuda aqui pra saber se tem um outro jeito.
Eu queria por exemplo que funcionasse igual o edittext da barra de endereço do chrome. Quando eu fecho o teclado, o focus nao esta mais no edittext, entao acho que ali ele verifica se o focus esta ou nao no edittext ao inves de verificar se o teclado esta aberto ou fechado. Mas o que mais importa eh, se eu clicar no edittext (o que vai fazer com que o teclado abra) e depois virar o celular, quero que ele entre naquele modo de escrita em landscape automaticamente.
--
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
public class MyEditText extends EditText {
public MyEditText(Context context) {
super(context);
}
@Override
public boolean onKeyPreIme(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
this.clearFocus();
}
return super.onKeyPreIme(keyCode, event);
}
}<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="bottom"
android:orientation="vertical" >
<com.example.irclient2.adapter.MyEditText
android:id="@+id/chatinput"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:imeOptions="actionSend|flagNoExtractUi"
android:inputType="textCapSentences" />
<ListView
android:id="@+id/chatlist"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@id/chatinput"
android:background="@drawable/fundo_chat"
android:divider="@android:color/transparent"
android:dividerHeight="1.0sp"
android:padding="5dp"
android:scrollingCache="false"
android:smoothScrollbar="true" >
</ListView>
</RelativeLayout>Seu construtor está errado:
http://developer.android.com/training/custom-views/create-view.html
"at a minimum you must provide a constructor that takes a Context and an AttributeSet object as parameters"
if (savedInstanceState.getBoolean(KEYBOARDSHOW)) {
edittext.requestFocus();
InputMethodManager imm = (InputMethodManager) activity
.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.showSoftInput(edittext, InputMethodManager.SHOW_FORCED);
}Coitado, ninguém sugeriu pra ele deixar essa ideia de lado...
--
--
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Coloque essa tag na sua activity:
android:configChanges="orientation|screenSize"Lists configuration changes that the activity will handle itself. When a configuration change occurs at runtime, the activity is shut down and restarted by default, but declaring a configuration with this attribute will prevent the activity from being restarted. Instead, the activity remains running and itsmethod is called.onConfigurationChanged()
Note: Using this attribute should be avoided and used only as a last resort. Please read Handling Runtime Changes for more information about how to properly handle a restart due to a configuration change.
Sim Matheus, não é muito recomendado, mas pelo seu post e desespero, achei que poderia servir :)
--
You received this message because you are subscribed to a topic in the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/androidbrasil-dev/La5eaGqr8Ws/unsubscribe.
To unsubscribe from this group and all its topics, send an email to androidbrasil-...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-...@googlegroups.com.
Geovani, é um aplicativo de chat, então o teclado vai ser muito usado. Sabe quando você vai digitar uma mensagem pra alguém e decide em algum momento virar o celular pra digitar melhor e ele vira fácil e rápido pronto pra você continuar digitando? É isso que eu quero no meu app :(
--
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.