I am stuck here, I used a Textview previously but the content is cut off at the bottom so I tried using a webview to display the contents inside a fragment using a Tabbed Activity which is my current view. This is the current output using a Tablet : Current
This is my xml code for the fragment
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="8dp"
tools:context="org.gandroid.motif.Methods$PlaceholderFragment">
<WebView
android:id="@+id/FPBriefsumm"
android:layout_width="match_parent"
android:layout_height="0dp"
android:background="@null"
android:layout_weight="1"
android:paddingBottom="2dp"
/>
and this is my java class for the fragment:
public class Methods_FamilyPlanning_brief extends Fragment {
TextView FPdesc,FPtitle;
WebView webView;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_methods, container, false);
webView = rootView.findViewById(R.id.FPBriefsumm);
webView.loadUrl("file:///android_asset/familyplanning.html");
webView.setBackgroundColor(Color.TRANSPARENT);
WebSettings webSettings = webView.getSettings();
webSettings.setJavaScriptEnabled(true);
// Force links and redirects to open in the WebView instead of in a browser
webView.setWebViewClient(new WebViewClient());
I had tried all possible solutions from here:
- fragment-content-gets-cut-off
- android-listview-inside-fragment-gets-cut-off
- android-xml-cutting-off-bottom-half-of-layout
- android-studio-project-bottom-of-ui-is-cut-off Still no luck :( I tried it running on emulator and different physical devices but still the same. All I just wanna do is display a very long content in this fragment. Any idea would be great. Thanks in advance.
UPDATE : I tried @Mahesh answer it now looks like this. The last paragraph is missing.
My html code for the webview file.
<html>
Family Planning
Family planning is the practice of controlling the number of children in a family and the intervals between their births. Contemporary notions of family planning, however, tend to place a woman and her childbearing decisions at the center of the discussion, as notions of womens empowerment and reproductive autonomy have gained traction in many parts of the world. Family planning may involve consideration of the number of children a woman wishes to have, including the choice to have no children, as well as the age at which she wishes to have them. These matters are influenced by external factors such as marital situation, career considerations, financial position, any disabilities that may affect their ability to have children and raise them, besides many other considerations.
If sexually active, family planning may involve the use of contraception and other techniques to control the timing of reproduction. Other techniques commonly used include sexuality education, prevention and management of sexually transmitted infections,pre-conception counseling and management, and infertility management.
Family planning is sometimes used as a synonym or euphemism for access to and the use of contraception. However, it often involves methods and practices in addition to contraception. Additionally, there are many who might wish to use contraception but are not, necessarily, planning a family (e.g., unmarried adolescents, young married couples delaying childbearing while building a career); family planning has become a catch-all phrase for much of the work undertaken in this realm. It is most usually applied to a female-male couple who wish to limit the number of children they have and/or to control the timing of pregnancy (also known as spacing children).
Do you know when your last menstrual period began or how long it lasted? If not, it might be time to start paying attention.
Tracking your menstrual cycles can help you understand what's normal for you, time ovulation and identify important changes — such as a missed period or unpredictable menstrual bleeding. While menstrual cycle irregularities usually aren't serious, sometimes they can signal health problems.
What's the menstrual cycle?
The menstrual cycle is the monthly series of changes a woman's body goes through in preparation for the possibility of pregnancy. Each month, one of the ovaries releases an egg — a process called ovulation. At the same time, hormonal changes prepare the uterus for pregnancy. If ovulation takes place and the egg isn't fertilized, the lining of the uterus sheds through the vagina. This is a menstrual period.
What's normal?
The menstrual cycle, which is counted from the first day of one period to the first day of the next, isn't the same for every woman. Menstrual flow might occur every 21 to 35 days and last two to seven days. For the first few years after menstruation begins, long cycles are common. However, menstrual cycles tend to shorten and become more regular as you age.
Your menstrual cycle might be regular — about the same length every month — or somewhat irregular, and your period might be light or heavy, painful or pain-free, long or short, and still be considered normal. Within a broad range, "normal" is what's normal for you.
Keep in mind that use of certain types of contraception, such as extended-cycle birth control pills and intrauterine devices (IUDs), will alter your menstrual cycle. Talk to your health care provider about what to expect.
When you get close to menopause, your cycle might become irregular again. However, because the risk of uterine cancer increases as you age, discuss any irregular bleeding around menopause with your health care provider.
</body>
</html>