Android studio error: resource not found Exception - android

i have a problem with my app: i'm using crashlytics by Fabric, (my app is pubblishes in the play store) to have log of possible crash, and i have this error ".. MainActivity: android.content.res.Resource$NotFoundException:Resource ID#0x7f09001b"
(Crashlytics say to me that the device is a samsung galaxy s4 with Android 5.1 and root )
CrashLytics screen
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Fabric.with(this, new Crashlytics());
setContentView(R.layout.activity_main); <---- LINE 102 THAT GIVE
THE ERROR , ACCORDING TO
CRASHLYTICS
ping = (ImageButton)findViewById(R.id.ping);
internet =(TextView)findViewById(R.id.Internet);
banda5Ghz =(TextView)findViewById(R.id.BandeSupp);
SpeedNet =(TextView)findViewById(R.id.VR);
ipv6 =(TextView)findViewById(R.id.showIPv6);
txVsegnale =(TextView)findViewById(R.id.intensità);
aggiorna = (ImageButton)findViewById(R.id.Aggiorna);
share = (ImageButton)findViewById(R.id.sharebtn);
clipboard = (ImageButton)findViewById(R.id.clipboard);
rating = (ImageButton)findViewById(R.id.ratebtn);
IP =(TextView)findViewById(R.id.IP);
showIPv4 =(TextView)findViewById(R.id.showIPv4);
// TextViewWifi =(TextView)findViewById(R.id.TextViewWifi);
TextViewwifi_info = (TextView)findViewById(R.id.wifi_info);
MacA = (TextView)findViewById(R.id.MacAdd);
//switch gestione notifiche
notifiche = (Switch)findViewById(R.id.switchNot);`
......
The same device crash 2 times in a short time, with same error.
My app is an app that show infos on your wifi connection, such as IP, network velocity, etc etc, also have system notification and widgets and a service that run in background .
I have also done different layout for different devices with different screen size and different screen dpi
My Layouts
No other logs from other device with same problem .I want to know if is a specific problem of this device ( may be related to root access given to this device ) or is a problem of my application.
Not sure if it is linked to this, but, i was tryeing to add split screen function to my app, and , adding android:resizeableActivity="true" to manifest, make app crash in the same code line, so, i solve by settings to false and not include split screen feature in my app.
I CONFIRMED THAT TRIEING TO USE SPLIT SCREEN GIVE ME THE SAME ERROR, SAME RESOURCE NOT FOUND EXCEPTION, how can i see which resource have this id ?
android.content.res.Resources$NotFoundException: Resource ID #0x7f09001b
THE APP Crash only in this case , no other crash, do i have to define a minimum width and weight to use split Screen ?
`<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.ShowMyIp.utente.ShowMyIp.MainActivity">
<TextView
android:id="#+id/Internet"
android:layout_width="match_parent"
android:layout_height="225dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:background="#drawable/roundcorner"
android:layout_marginTop="8dp"
android:paddingTop="27dp"
android:textColor="#646464"
android:textSize="13sp"
android:layout_marginLeft="7dp"
android:layout_marginRight="8dp"
android:textStyle="italic" />
<TextView
android:id="#+id/Internet2"
android:layout_width="match_parent"
android:layout_height="195dp"
android:layout_alignEnd="#+id/internet4"
android:layout_below="#+id/internet4"
android:layout_marginTop="14dp"
android:layout_marginLeft="7dp"
android:background="#drawable/roundcorner" />
<TextView
android:id="#+id/internet4"
android:layout_width="match_parent"
android:layout_height="195dp"
android:layout_alignStart="#+id/Internet"
android:layout_below="#+id/Internet"
android:layout_marginRight="8dp"
android:layout_marginTop="17dp"
android:background="#drawable/roundcorner"
android:textSize="13sp" />
<TextView
android:id="#+id/MacAdd"
android:layout_width="275dp"
android:layout_height="35dp"
android:layout_alignStart="#+id/txtMac"
android:layout_below="#+id/BandeSupp"
android:layout_marginTop="35dp"
android:textAlignment="viewStart"
android:textColor="#android:color/black"
android:textSize="15sp" />
<TextView
android:id="#+id/IP"
android:layout_width="150dp"
android:layout_height="45dp"
android:layout_alignBaseline="#+id/Internet"
android:layout_alignBottom="#+id/Internet"
android:layout_alignStart="#+id/internet4"
android:layout_marginStart="45dp"
android:text="IP Address"
android:textColor="#E1E140"
android:textSize="18sp"
android:textStyle="italic" />
<TextView
android:id="#+id/showIPv4"
android:layout_width="230dp"
android:layout_height="45dp"
android:layout_alignStart="#+id/IP"
android:layout_below="#+id/intensità"
android:textColor="#android:color/black"
android:textSize="16sp"
android:textStyle="bold" />
<TextView
android:id="#+id/wifi_info"
android:layout_width="220dp"
android:layout_height="55dp"
android:layout_alignStart="#+id/showIPv4"
android:layout_below="#+id/showIPv4"
android:text="Non Connesso"
android:textColor="#android:color/black"
android:textSize="16sp"
android:textStyle="italic" />
<TextView
android:id="#+id/velocita"
android:layout_width="155dp"
android:layout_height="45dp"
android:layout_above="#+id/VR"
android:layout_alignEnd="#+id/txvIPV6"
android:text="Velocità rete"
android:textColor="#E1E140"
android:textSize="18sp"
android:textStyle="italic" />
<TextView
android:id="#+id/VR"
android:layout_width="135dp"
android:layout_height="45dp"
android:layout_alignBottom="#+id/wifi_info"
android:layout_alignEnd="#+id/velocita"
android:textColor="#android:color/black"
android:textSize="16sp"
android:textStyle="italic" />
<ImageButton
android:id="#+id/Aggiorna"
android:layout_width="200dp"
android:layout_height="75dp"
android:layout_alignEnd="#+id/intensità"
android:layout_alignTop="#+id/Internet2"
android:layout_marginEnd="21dp"
android:layout_marginTop="56dp"
android:background="#android:color/transparent"
android:scaleType="fitCenter"
android:textColor="#android:color/white"
app:srcCompat="#drawable/btn_aggiorna" />
<TextView
android:id="#+id/intensità"
android:layout_width="190dp"
android:layout_height="65dp"
android:layout_alignEnd="#+id/Internet"
android:layout_alignTop="#+id/IP"
android:layout_marginEnd="21dp"
android:textColor="#android:color/black"
android:textSize="18sp" />
<TextView
android:id="#+id/txtMac"
android:layout_width="140dp"
android:layout_height="35dp"
android:layout_alignStart="#+id/showIPv4"
android:layout_alignTop="#+id/internet4"
android:layout_marginTop="28dp"
android:text="MAC Address"
android:textColor="#E1E140"
android:textSize="18sp" />
<Switch
android:id="#+id/switchNot"
android:layout_width="145dp"
android:layout_height="85dp"
android:layout_alignStart="#+id/MacAdd"
android:layout_alignTop="#+id/Aggiorna"
android:layout_marginStart="28dp"
android:textColor="#E1E140"
android:textSize="18sp"
tools:text="Notifiche" />
<TextView
android:id="#+id/txvIPV6"
android:layout_width="75dp"
android:layout_height="45dp"
android:layout_alignBottom="#+id/txtMac"
android:layout_alignEnd="#+id/Aggiorna"
android:text="IPV6"
android:textColor="#E1E140"
android:textSize="18sp" />
<TextView
android:id="#+id/showIPv6"
android:layout_width="220dp"
android:layout_height="45dp"
android:layout_alignBottom="#+id/MacAdd"
android:layout_alignStart="#+id/Aggiorna"
android:textAlignment="viewStart"
android:textColor="#android:color/black"
android:textSize="17sp" />
<ImageButton
android:id="#+id/ratebtn"
android:layout_width="55dp"
android:layout_height="55dp"
android:layout_alignEnd="#+id/Internet2"
android:layout_alignParentBottom="true"
android:layout_marginBottom="22dp"
android:layout_marginEnd="10dp"
android:background="#android:color/transparent"
app:srcCompat="#drawable/rating_button"
android:scaleType="fitCenter"
/>
<ImageButton
android:id="#+id/sharebtn"
android:layout_width="55dp"
android:layout_height="55dp"
android:layout_alignTop="#+id/ratebtn"
android:layout_marginEnd="23dp"
android:layout_toStartOf="#+id/ratebtn"
android:background="#android:color/transparent"
android:scaleType="fitCenter"
app:srcCompat="#drawable/share_button" />
<ImageButton
android:id="#+id/clipboard"
android:layout_width="55dp"
android:layout_height="55dp"
android:layout_alignTop="#+id/sharebtn"
android:layout_toStartOf="#+id/VR"
android:background="#android:color/transparent"
android:scaleType="fitCenter"
app:srcCompat="#drawable/clipboard" />
<TextView
android:id="#+id/BandeSupp"
android:layout_width="130dp"
android:layout_height="55dp"
android:layout_alignTop="#+id/txvIPV6"
android:layout_toEndOf="#+id/showIPv4"
android:textColor="#android:color/black"
android:visibility="invisible"
android:textSize="17sp" />
<ImageButton
android:id="#+id/ping"
android:layout_width="90dp"
android:layout_height="90dp"
android:layout_alignBottom="#+id/clipboard"
android:layout_alignEnd="#+id/switchNot"
android:background="#android:color/transparent"
android:visibility="invisible"
app:srcCompat="#drawable/ping" />
</RelativeLayout>`
here is my layout (large-port-mdpi)
App still crash entering in split screen mode, with "no found exception ..." ; i've made another simple app , following Android developer guide to make multiview support, and this app work, no problem when entering in split screen, , i only added to the Manifest same code i wrote for this app " android:resizeableActivity="true"". Anyone know about to resolve this error? why my app, dosen't find layout resource entering in split screen mode??

Check your MainActivity Layout Xml in Text Format, There Has to be Line with a Yellow Warning on it, Or a Red Line.
Check the Layout Xml, And Then,
Check If You Missed Something Like LinearLayout Being RelativeLayout and you Declared it with this mistake.
Then Check If You've Used Anything like below:
RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) myRelativeLayout.getLayoutParams();
LinearLayout.LayoutParams Param1 = (LinearLayout.LayoutParams) myLinearLayout.getLayoutParams();
If Yes, Reply me and I'll tell you what to do.

Related

Auto resize Textview

My goal is to create Auto rotate textView.Here is my xml code
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center">
<TextView
android:id="#+id/u_major_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="#dimen/u_common_margin_left"
android:maxLines="1"
android:paddingRight="#dimen/u_common_margin_left"
android:singleLine="true"
android:text="0.00"
android:autoSizeTextType="uniform"
android:autoSizeMinTextSize="12dp"
android:autoSizeMaxTextSize="70dp"
android:autoSizeStepGranularity="2dp"
android:textColor="#000000"
android:textSize="70dp"
/>
<TextView
android:id="#+id/u_minor_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="#+id/u_major_text"
android:layout_marginLeft="-12dp"
android:layout_marginTop="7dp"
android:layout_toEndOf="#+id/u_major_text"
android:layout_toRightOf="#+id/u_major_text"
android:gravity="center"
android:singleLine="true"
android:text="₾"
android:textColor="#000000"
android:textSize="30dp" />
</RelativeLayout>
my goal is to my minor_textview can to be auto resize function.first time text size is 70dp but I want to decrease size depends on a text. What am I doing wrong ?
Apparently, since Android 8.0 and below (thanks to the Support Library) you can use an attribute to auto resize your Textview:
TextView minorText = findViewById(R.id.u_minor_text);
TextViewCompat.setAutoSizeTextTypeWithDefaults(text, TextViewCompat.AUTO_SIZE_TEXT_TYPE_UNIFORM);
Check this link:
https://developer.android.com/guide/topics/ui/look-and-feel/autosizing-textview

Android Studio XML - How to get imageview in front of button?

The question is quite simple. How do I get this imageview below to be visible in front of the button below?
I am looking for an XML answer, not a Java answer. Seeing java (I think) will not change anything in the preview screen while working on the xml file.
<ImageView
android:layout_width="35dp"
android:layout_height="35dp"
android:background="#drawable/iconfb"
android:layout_marginTop="90dp"
android:layout_marginLeft="12.5pt"
android:id="#+id/iconfb"
/>
<Button
android:layout_width="300dp"
android:layout_height="40dp"
android:text="Sign in with facebook"
android:onClick="invokefb"
android:textColor="#color/white"
android:textStyle="bold"
android:background="#color/tmfacebook"
android:layout_marginTop="-20dp"
android:layout_marginLeft="12.5pt"
android:id="#+id/fblogin"
"/>
<Button
android:id="#+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawablePadding="10dp"
android:drawableLeft="#drawable/fb"
android:text="Facebook"/>

Saving state of the view

Is there an easy way to save a whole viewgroup with its data together? For example if initially i have this view and during the app run some of the view's background image changes, some views become invisible, or its' text changes, etc. How can I save the state of the view, in case user quits app?
<RelativeLayout android:layout_width="wrap_content" android:id="#+id/water_room_common"
android:layout_height="wrap_content" xmlns:android="http://schemas.android.com/apk/res/android"
>
<!-- storage layout -->
<View android:id="#+id/gap" android:layout_width="wrap_content"
android:layout_height="0dip" android:layout_alignParentBottom="true" />
<RelativeLayout android:id="#+id/storage"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_above="#id/gap" android:layout_marginBottom="10dp"
android:layout_marginRight="27dp" android:layout_marginLeft="10dp"
android:layout_toLeftOf="#id/bag" android:orientation="horizontal"
>
<ImageButton android:id="#+id/ImageButton02"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_alignTop="#+id/ImageButton01"
android:layout_marginRight="16dp" android:layout_toLeftOf="#+id/ImageButton01"
android:background="#drawable/single_square" android:onClick="itemSelected" />
<ImageButton android:id="#+id/ImageButton03"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_alignTop="#+id/ImageButton01"
android:layout_centerHorizontal="true" android:layout_marginRight="16dp"
android:layout_toLeftOf="#+id/ImageButton02" android:background="#drawable/single_square"
android:onClick="itemSelected"
/>
<ImageButton android:id="#+id/ImageButton04"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_alignTop="#+id/ImageButton01"
android:layout_marginRight="16dp" android:layout_toLeftOf="#+id/ImageButton03"
android:adjustViewBounds="true" android:background="#drawable/single_square"
android:onClick="itemSelected"
/>
<ImageButton android:id="#+id/ImageButton05"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_alignTop="#+id/ImageButton01"
android:layout_marginRight="16dp" android:layout_toLeftOf="#+id/ImageButton04"
android:adjustViewBounds="true" android:background="#drawable/single_square"
android:onClick="itemSelected"
/>
<ImageButton android:id="#+id/ImageButton06"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_alignTop="#+id/ImageButton01"
android:layout_marginRight="16dp" android:layout_toLeftOf="#+id/ImageButton05"
android:adjustViewBounds="true" android:background="#drawable/single_square"
android:onClick="itemSelected"
/>
<ImageButton android:id="#+id/ImageButton01"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true" android:background="#drawable/single_square"
android:onClick="itemSelected"
/>
</RelativeLayout>
<ImageButton android:id="#+id/bag" android:layout_width="65dp"
android:layout_height="65dp" android:layout_alignBottom="#+id/storage"
android:layout_alignParentRight="true" android:layout_marginRight="10dp"
android:adjustViewBounds="true"
android:onClick="bagClicked"/>
<ImageButton android:id="#+id/left" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_alignLeft="#+id/storage"
android:layout_centerVertical="true" android:background="#null"
android:onClick="previousWall" android:src="#drawable/left" />
<ImageButton android:id="#+id/right" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_alignRight="#id/bag"
android:layout_centerVertical="true" android:background="#null"
android:onClick="nextWall" android:src="#drawable/right" />
</RelativeLayout>
See this answer. You need to override onSaveInstanceState for transient changes or override onPause and onResume for permanent changes.
Read the API guide here
Update
This is a summary of this training
Picture this scenario. You have a notepad app. On the homescreen, the user has a list of recently created notes (NoteList Activity) and the user can choose to create a new note or edit an existing note and changes will be stored in a database.
When the user clicks on an item brings another activity (NoteEditActivity) to the foreground. If the user is in the process of editting a note and the NoteEditActivity loses focus for some reason (e.g a call comes in or the user just decides to switch to another app without clicking the "confirm button") the NoteEditActivity goes from being focused to being paused and then shortly after it is stopped.
To prevent the user from loosing the current edit, you need to call onPause where you would want to save any changes to the database. Now if the app is in the stopped (onStop) and the user returns to the edit it will not go through onCreate but rather through onResume which is where you want to "resume" from where the user left.
This picture should further explain.
Notice how onResume gets called every time the activity is about to be focused and not onCreate.
You can follow the training above for better understanding.

Zoom controls for several images in a relative layout

I'm new with android, and I have to make improvements for an existing app. Inside this app we have a relative layout with a group of 15 imageViews, 1 dynamic imageView and two textViews to which I have to program zoom controls for zooming in and out. The last couple of days I've been reading continuously this website to try to find an answer in the existing questions without any results because lots of questions are without an answer.
My biggest problem is that I don't know which frame or layout to use. All the images are placed and working well in the relative layout, but I don't seem to get the zoom controls working with the content and I've read in different threads and questions that the RelativeLayout doesn't work with zoom at all. I thought of maybe using a FrameLayout but I think it has the same problem.
This is the XML code from the layout:
<RelativeLayout
android:id="#+id/relativeLayoutMachine"
android:layout_width="1000dp"
android:layout_height="550dp"
android:layout_above="#+id/relativeLayout1"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:background="#color/brm_back_1" >
<ImageView
android:id="#+id/imageView01"
android:layout_width="82dp"
android:layout_height="67dp"
android:layout_marginLeft="409dp"
android:layout_marginTop="83dp"
android:contentDescription="#id/imageVeuwBandInloopKoker"
android:src="#drawable/lva_bandinloopkoker" />
<ImageView
android:id="#+id/imageView02"
android:layout_width="82dp"
android:layout_height="67dp"
android:layout_marginLeft="409dp"
android:layout_marginTop="149dp"
android:contentDescription="#id/imageViewTussenKoker"
android:src="#drawable/lva_tussenkoker" />
<ImageView
android:id="#+id/imageView03"
android:layout_width="172dp"
android:layout_height="88dp"
android:layout_marginLeft="401dp"
android:layout_marginTop="216dp"
android:contentDescription="#id/imageViewHMI_Graph_04_Flap"
android:src="#drawable/lva_flap_open" />
<ImageView
android:id="#+id/imageView04"
android:layout_width="281dp"
android:layout_height="61dp"
android:layout_marginLeft="401dp"
android:layout_marginTop="303dp"
android:contentDescription="#id/imageViewHMI_Graph_03_Ram"
android:src="#drawable/lva_ram_retour" />
<ImageView
android:id="#+id/imageView05"
android:layout_width="110dp"
android:layout_height="47dp"
android:layout_marginLeft="571dp"
android:layout_marginTop="257dp"
android:contentDescription="#id/imageViewHMI_Graph_01_Unit"
android:src="#drawable/lva_unit" />
<ImageView
android:id="#+id/imageView06"
android:layout_width="51dp"
android:layout_height="54dp"
android:layout_marginLeft="431dp"
android:layout_marginTop="28dp"
android:contentDescription="#id/imageViewHMI_Graph_15_Feeder"
android:src="#drawable/lva_feeder_off" />
<ImageView
android:id="#+id/imageView07"
android:layout_width="90dp"
android:layout_height="40dp"
android:layout_marginLeft="585dp"
android:layout_marginTop="218dp"
android:contentDescription="#id/imageViewHMI_Graph_02_Pump"
android:src="#drawable/lva_main_motor_off" />
<ImageView
android:id="#+id/imageView08"
android:layout_width="199dp"
android:layout_height="124dp"
android:layout_marginLeft="157dp"
android:layout_marginTop="240dp"
android:contentDescription="#id/imageViewChannel"
android:src="#drawable/lva_channel" />
<ImageView
android:id="#+id/imageView09"
android:layout_width="82dp"
android:layout_height="166dp"
android:layout_marginLeft="410dp"
android:layout_marginTop="50dp"
android:contentDescription="#id/imageViewHMI_Graph_013_Turbo"
android:src="#drawable/lva_turbo_off"
android:visibility="invisible" />
<ImageView
android:id="#+id/imageView10"
android:layout_width="88dp"
android:layout_height="67dp"
android:layout_marginLeft="402dp"
android:layout_marginTop="149dp"
android:contentDescription="#id/imageViewHMI_Graph_012_Perforator"
android:src="#drawable/lva_perforator_off"
android:visibility="invisible" />
<ImageView
android:id="#+id/ImageView11"
android:layout_width="88dp"
android:layout_height="67dp"
android:layout_marginLeft="408dp"
android:layout_marginTop="149dp"
android:contentDescription="#id/ImageViewHMI_Graph_10_Ruffler"
android:src="#drawable/lva_ruffler_off"
android:visibility="invisible" />
<ImageView
android:id="#+id/ImageView12"
android:layout_width="174dp"
android:layout_height="72dp"
android:layout_marginLeft="362dp"
android:layout_marginTop="146dp"
android:contentDescription="#id/ImageViewHMI_Graph_11_Prepress"
android:src="#drawable/lva_prepress_open"
android:visibility="invisible" />
<ImageView
android:id="#+id/imageView13"
android:layout_width="46dp"
android:layout_height="68dp"
android:layout_marginLeft="356dp"
android:layout_marginTop="297dp"
android:contentDescription="#id/imageViewHMI_Graph_07_Needles_Hor"
android:src="#drawable/lva_needles_hor_none" />
<ImageView
android:id="#+id/imageView14"
android:layout_width="44dp"
android:layout_height="111dp"
android:layout_marginLeft="356dp"
android:layout_marginTop="187dp"
android:contentDescription="#id/imageViewHMI_Graph_05_Needles_Vert"
android:src="#drawable/lva_needles_vert_high" />
<ImageView
android:id="#+id/imageView15"
android:layout_width="10dp"
android:layout_height="24dp"
android:layout_marginLeft="371dp"
android:layout_marginTop="272dp"
android:contentDescription="#id/imageViewHMI_Graph_06_Knotter_Vert"
android:src="#drawable/lva_motor_off" />
<FrameLayout
android:id="#+id/frameLayoutBale"
android:layout_width="140dp"
android:layout_height="51dp"
android:layout_marginLeft="19dp"
android:layout_marginTop="307dp" >
<ImageView
android:id="#+id/imageViewAnimation"
android:layout_width="140dp"
android:layout_height="51dp"
android:layout_gravity="right"
android:contentDescription="#id/imageViewHMI_Graph_Bale"
android:scaleType="fitXY"
android:src="#drawable/baal" />
</FrameLayout>
<TextView
android:id="#+id/textView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="110dp"
android:layout_marginTop="316dp"
android:gravity="right"
android:text="#string/percentage"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#color/brm_back_2" />
<TextView
android:id="#+id/textView02"
android:layout_width="142dp"
android:layout_height="wrap_content"
android:layout_marginLeft="22dp"
android:layout_marginTop="271dp"
android:gravity="center"
android:text="#string/puntjes"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#color/brm_back_2" />
<ZoomControls
android:id="#+id/zoomControls"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignRight="#+id/textCurrMaterial" />
</RelativeLayout>
This is the code I used on my main to declare the zoom controls:
btnZoomControls = (ZoomControls) findViewById(R.id.zoomControls);
btnZoomControls.setOnZoomInClickListener(new View.OnClickListener() {public void onClick(View v) {setZoomIn(); }});
btnZoomControls.setOnZoomOutClickListener(new View.OnClickListener() {public void onClick(View v) {setZoomOut(); }});
And this are the functions for zooming in and out
private void setZoomIn()
{
m_ZoomController.getContainer();
m_ZoomController.getZoomControls();
m_ZoomController.setZoomInEnabled(true);
}
private void setZoomOut()
{
m_ZoomController.getContainer();
m_ZoomController.getZoomControls();
m_ZoomController.setZoomOutEnabled(true);
}
Had any of you a similar problem like mine, and how you found a solution to fix it?
Actually, You have two major ways for zooming:
1) Call setScaleX() and setScaleY() (since API 11) on whole layout or on particular view. Per my experience, images scaling works fine, but text on some versions produces weird behaviour (this scaling get applied by view group during draw process and so, quite fast). This way is quite smooth and fast for not very big layouts;
2) Change layout parameters on every view (You might need, probably, to provide new pictures for image views during scaling). This way is not so fast, but should work on almost all android revisions.

How to invisible line in list view for android Honey comb

I m creating an app in that app i want to invisible this Mr. bla bla two line when i clicked on chat image.
any suggestion will be appriciate.
thanks in advance.
this is my xml file.
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/task_list_frag_list_message_layout"
android:background="#EBEBEB"
android:layout_marginBottom="10dp"
android:descendantFocusability ="blocksDescendants"
android:layout_marginTop="10dp"
android:layout_below="#+id/task_list_text"
android:layout_marginLeft="80dp"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/task_list_chat_persion1"
android:text="Mr. Test : "
android:textSize="18dp"
android:layout_marginTop="13dp"
android:textColor="#color/sky_blue_color"
/>
<TextView android:textColor="#color/black_color"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/task_list_chat_text1"
android:text="A send you a data file kindly get it."
android:textSize="18dp"
android:layout_marginTop="13dp"
android:layout_toRightOf="#+id/task_list_chat_persion1"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/task_list_chat_persion2"
android:text="Mr. me : "
android:textSize="18dp"
android:layout_marginTop="13dp"
android:layout_below="#+id/task_list_chat_persion1"
android:textColor="#color/sky_blue_color"
/>
<TextView android:textColor="#color/black_color"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/task_list_chat_text2"
android:text="I got the data file and i have some doubt in them"
android:textSize="18dp"
android:layout_marginTop="13dp"
android:layout_below="#+id/task_list_chat_persion1"
android:layout_toRightOf="#+id/task_list_chat_persion2"
/>
</RelativeLayout>
this two lines are ij relative latout.
I think you want this ...
just need to add onClick() event on chat image and then on clicking set visibility of TextView to invisible by code.
TextView _text= (TextView)findViewById(R.id.task_list_chat_text);
_text.setVisibility(TextView.INVISIBLE);
When you click on chat button in the list view you should setTest="" blank for both remove it.
It may be solution of this problem.

Categories

Resources