Note that there are some explanatory texts on larger screens.

plurals
  1. POaccess the imageview from activity to fragment in android
    primarykey
    data
    text
    <p>I have to develop one android application.</p> <p>Here i have using <strong>fragment</strong> concept.</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" android:id="@+id/_listDetails" &gt; &lt;RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:id="@+id/layout" &gt; &lt;ImageView android:id="@+id/pos" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:layout_toLeftOf="@+id/neg" android:src="@drawable/a_pos_off" /&gt; &lt;ImageView android:id="@+id/neg" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical" android:layout_toLeftOf="@+id/imageView5" android:src="@drawable/a_neg_off" /&gt; &lt;/RelativeLayout&gt; &lt;LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_below="@+id/layout" android:orientation="horizontal" &gt; &lt;fragment android:id="@+id/activity_main" android:name="com.xmlparsing.MainActivity" android:layout_width="0px" android:layout_height="match_parent" android:layout_weight="1" /&gt; &lt;fragment android:id="@+id/fragment2" android:name="com.xmlparsing.SubCate" android:layout_width="0px" android:layout_height="match_parent" android:layout_weight="1" /&gt; &lt;/LinearLayout&gt; &lt;/RelativeLayout&gt; </code></pre> <p>Here i have used <strong>Two fragments</strong>..They are ., MainActivity.java and SubCate.java</p> <pre><code> public class AndroidListFragmentActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.fragment); }} </code></pre> <p>Here The positive image is there in fragment.xml file...Here if i have to click these positive image which means the have to increase the text size for fullcontent of second fragement (SubCate.java )...</p> <p>How can i do ??? pls give me solution for these ... </p> <p>This is my <strong>Second Fragment</strong> (SubCate.java) code:</p> <pre><code> @TargetApi(Build.VERSION_CODES.HONEYCOMB) public class SubCate extends Fragment { int count = 0, i, j; WebSettings webSettings; WebView fullcontent; ImageView positive,negative; AndroidListFragmentActivity _listDetailsFrag; View activityView; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.subcate, container, false); fullcontent = (WebView) view.findViewById(R.id.fullcontent); Bundle bundle = getArguments(); return view; } public void updateDetail(String articlefullcontent) { _FullContent = articlefullcontent.substring(1); fullcontent.setWebChromeClient(new WebChromeClient()); webSettings = fullcontent.getSettings(); fullcontent.getSettings(); fullcontent.loadDataWithBaseURL(null, _FullContent, "text/html", "utf-8", null); positive = ((ImageView )activityView.findViewById(R.id.pos)); positive.setOnClickListener(new OnClickListener() { public void onClick(View v) { count++; if (count == -1) { webSettings.setTextSize(WebSettings.TextSize.SMALLER); positive.setImageResource(R.drawable.a_pos_off); negative.setImageResource(R.drawable.a_neg_on); } else if (count == 0) { webSettings.setTextSize(WebSettings.TextSize.NORMAL); positive.setImageResource(R.drawable.a_pos_off); negative.setImageResource(R.drawable.a_neg_off); } else if (count &gt;= 1) { count=1; webSettings.setTextSize(WebSettings.TextSize.LARGER); positive.setImageResource(R.drawable.a_pos_on); negative.setImageResource(R.drawable.a_neg_off); } } }); } } </code></pre> <p>I have to run the app and click that imageview means the fullcontent text is not increase the value...How can i do ??? please help me and provide me some solution ???</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload