android - How to make progress bar of activity visible in fragment -


i defined fragement , loaded in activity, there progress bar in activity layout, how can make progress bar visible when in fragment

how make progress bar of activity visible in fragment

use getactivity().findviewbyid in fragment accessing views parent activity of fragments:

progressbar progressbar = (progressbar)                  getactivity().findviewbyid(r.id.progress_bar_id); 

now use progressbar show , hide progressbar.

note: make sure adding fragments in fragmentmanager after calling setcontentview in activity


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -