c# - Make null columns invisible in DataGridView - Stack Overflow
java - Android setVisibility View.INVISIBLE and View.GONE aren't working - Stack Overflow
applications - How can I delete a (null) app in usage? - Ask Different
applications - In my iPad settings there is an app called null what is it? - Ask Different
What are Null App PC requirements?
Minimum requirement to run Null App on your PC
- OS: Microsoft Windows 7 and above:
- Processor: Intel or AMD Processor:
- RAM: Your PC must have at least 2GB of RAM. (Note that having 2GB or more disk space is not a substitute for RAM):
- HDD: 5GB Free Disk Space.
- You must be an Administrator on your PC.
How to Run Null App on Windows PC & Mac?
Run Null App on your PC or Mac by following these simple steps.
- Click on ‘Download Null App on PC’ to download BlueStacks
- Install it and log-in to Google Play Store
- Launch and run the app.
Why is BlueStacks the fastest and safest platform to play games on PC?
BlueStacks respects your privacy and is always safe and secure to use. It does not carry any malware, spyware, or any sort of additional software that could harm your PC.
It is engineered to optimize speed and performance for a seamless gaming experience.
could this be because the compiler is trying to convert a null value to a string?
Correct, that's the exact case. Just it's not the compiler, but the code you have written.
I would suggest you encapsulating the empty cell logic into separate extension method inside the ExtensionGridView class:
public static bool IsEmpty(this DataGridViewCell cell)
{
var value = cell.Value;
return value == null || value == DBNull.Value || (value as string) == string.Empty;
}
Then you can use simple LINQ to determine the empty columns:
public static IEnumerable<DataGridViewColumn> EmptyColumns(this DataGridView gridView)
{
return gridView.Columns.Cast<DataGridViewColumn>()
.Where(c => gridView.Rows.Cast<DataGridViewRow>().All(r => r.Cells[c.Index].IsEmpty()));
}
Then your method could be simply like this:
public static DataGridView RemoveEmptyColumns(this DataGridView gridView)
{
foreach (var column in gridView.EmptyColumns())
column.Visible = false;
return gridView;
}
If Value is null, you'll get a NullReferenceException if using ToString() on it. So you have to null-check the value before using ToString().
Go like this:
// IF (Value is empty => use "").ToString() <-- IsNullOrEmpty
if (!string.IsNullOrEmpty(row.Cells[clm.Index].Value ?? "").ToString())
{
notAvailable = false;
break;
}
Check the details about ?? here.
Its the same as:
// If not null
if(row.Cells[clm.Index].Value != null)
{
// If string of value is empty
if(row.Cells[clm.Index].Value.ToString() != "")
{
notAvailable = false;
break;
}
}
Away from your problem here's a short version of everything:
public static DataGridView RemoveEmptyColumns(this DataGridView grdView)
{
for (int i = 0; i < grdView.ColumnCount; i++)
{
// On each iteration get all values of a column
IEnumerable<string> column = grdView.Rows.Cast<DataGridViewRow>().Select(row => (string)row.Cells[i].Value);
// If there is no value with length > 0 => visible = false
if (!column.Any(x => x.Length > 0)) { grdView.Columns[i].Visible = false; }
}
return grdView;
}
I think you are trying to show/hide the textviews based on whether the related json data is available. As for your current code:
infoHolder.yelp = (TextView) convertView.findViewById(R.id.theYelp);
if(infoHolder.yelp != null){
...
}
The if statement you declared is just checking whether the textview is null, it will never be null since its assigned a textview in the beginning. You should first determine whether the json data exists before deciding whether to show/hide the textview.
For example:
JSONObject jsonObject = this.dataArray.getJSONObject(position);
String yelpStr = jsonObject.optString("yelp");
if(yelpStr != null){
infoHolder.yelp.setText(yelpStr);
infoHolder.yelp.setVisibility(View.VISIBLE);
Toast.makeText(activity, "Yelp Here", Toast.LENGTH_LONG).show();
}else{
infoHolder.yelp.setVisibility(View.GONE);
Toast.makeText(activity, "Yelp Gone", Toast.LENGTH_LONG).show();
}
Also, I believe you misplaced a right curly brace, it should be right after infoHolder is retrieved using the tag:
if(convertView == null){
...
}else{
infoHolder = (allTheDealershipInfo) convertView.getTag();
}
Make sure u end the if/else statement for assigning infoHolder properly so the textviews will be used in the rest of the code as intended.
I think that you have to do something like this (only example for facebook):
public View getView(int position, View convertView, ViewGroup parent) {
allTheshipInfo infoHolder;
if(convertView == null){
convertView = inflater.inflate(R.layout.show_dealership_information, parent, false);
infoHolder = new allTheshipInfo();
infoHolder.facebook = (TextView) convertView.findViewById(R.id.theFacebook);
convertView.setTag(infoHolder);
} else infoHolder = (allTheDealershipInfo) convertView.getTag();
try {
JSONObject jsonObject = this.dataArray.getJSONObject(position);
if (jsonObject.getString("facebook") == null)
infoHolder.facebook.setVisibility(View.GONE);
} catch (JSONException e) {
e.printStackTrace(); }
return convertView;
}
It's not obvious where this app came from. According to the answer to this question, it probably is an app that was incompletely synced with iTunes.
There's nothing to worry about, and you don't need to do anything about it.
You can go to Settings-->General-->Storage&iCloud Usage-->Manage Storage. Then scroll down the apps to find null and delete it.