Posts

multiple activities in android java

Image
1)activity_main 2)secondactivity how to go second activity by button click ____ activity main xml file code  <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Go to next" android:gravity="bottom" android:onClick="callSecondActivity"   android:id="@+id/Button1"/> </LinearLayout> ___________ activity main .java file code package com.mycompany.multiple.ui.activity; import android.os.Bundle; import com.mycompany.multiple.R; import com.mycompany.multiple.common.activity.BaseActivity; import android.os.Bundle;   import android.view.View;   import android.content.Intent;   public cla...

2: AppCompatActivity and normal activity

What's the difference between AppCompatActivity and normal Activity? And what should I use? AppCompatActivity  is one of the main classes in the  Android Support Library . With every release of Android, new features are added, so the Android team works on supporting those new features for older devices. To solve this issue, they introduced the Android Support Library that can deliver latest features to older devices (as old as API v7). That is, they backport those new features and allow them to be present on older devices. In this library, the default base class used for activities is  AppCompatActivity  instead of the normal Activity class. Some of those features include Material Design widgets and support action bars, etc. Therefore, to get most out of the Android Support Library (that is, to get the latest features supported across the highest number of devices),  you must use AppCompatActivity instead of the normal Activity class .

1:Android java : textview scrollable

Image
make scrollable TextView 2 files main.xml  for design mainactivity.java   code for scrolling main.xml   <?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:background ="#000000"> < TextView android:id ="@+id/text_view" android:layout_width ="wrap_content" android:layout_height ="match_parent" android:text ="Story 1: Guru aur shishya \n  anything ...type..foyf yfyofoyfkyflyfyfylfkyfkyfkydkydkdkydkydkydkydkyd oydoydoydyodkydyodyodoydyodyodoydoydoydkydkydyld lhdyfhfjgudihyGuru aur shishya \n foyfyfyofoyfky flyfyfylfkyfkyGuru aur shishya \n foyfyfyofoy fkyflyfyfylfkyfkyGuru aur shishya \n foyfyfyofoyfk yflyfyfylfkyfkyGuru aur shishya \n foyfyfyofoyfkyfl yfyfylfkyfkyGuru aur shishya \n foyfyfyofo...